/** * @param workdir Working directory * @return True if creating an empty file is possible. */ default boolean isSupported(Path workdir) { return workdir.attributes().getPermission().isWritable(); }
/** * @param workdir Working directory in browser * @param name Folder name or null if unknown * @return True if creating directory will succeed */ default boolean isSupported(Path workdir, String name) { return workdir.attributes().getPermission().isWritable(); }
default boolean isSupported(final Path file) { return file.attributes().getPermission().isWritable(); }
/** * @param source Source file or folder * @param target Target file or folder * @return False if not supported for given files */ default boolean isSupported(Path source, Path target) { return target.getParent().attributes().getPermission().isWritable(); }
@Override public void allow(final String hostname, final PublicKey key, final boolean persist) { if(null == database) { super.allow(hostname, key, persist); } else { try { // Add the host key to the in-memory database final OpenSSHKnownHosts.HostEntry entry = new OpenSSHKnownHosts.HostEntry(null, PreferencesFactory.get().getBoolean( "ssh.knownhosts.hostname.hash") ? hash(hostname) : hostname, KeyType.fromKey(key), key); database.entries().add(entry); if(persist) { if(file.attributes().getPermission().isWritable()) { // Also try to add the key to a known_host file database.write(entry); } } } catch(IOException e) { log.error(String.format("Failure adding host key to database: %s", e.getMessage())); super.allow(hostname, key, persist); } } }
if(file.attributes().getPermission().isWritable()) { final NSImage badge = this.iconNamed("dropfolderbadge.tiff", size); badge.setName("dropfolderbadge"); if(!file.attributes().getPermission().isWritable()) { final NSImage badge = this.iconNamed("readonlyfolderbadge.tiff", size); badge.setName("readonlyfolderbadge");