public void setSortedAscending(boolean sortAscending) { //cache custom sorting preference this.sortAscending = sortAscending; //set default value PreferencesFactory.get().setProperty("browser.sort.ascending", this.sortAscending); }
/** * Defaults to 24 hours */ public AbstractPeriodicUpdateChecker(final Controller controller) { this(controller, Duration.ofSeconds(PreferencesFactory.get().getLong("update.check.interval"))); }
/** * @return The character encoding to be used when connecting to this server or null * if the default encoding should be used */ public String getEncoding() { if(null == encoding) { return PreferencesFactory.get().getProperty("browser.charset.encoding"); } return encoding; }
/** * New thread pool with first-in-first-out ordered fair wait queue and unlimited number of threads. * * @param prefix Thread name prefix */ public DefaultThreadPool(final String prefix) { this(prefix, PreferencesFactory.get().getInteger("threading.pool.size.max")); }
@Override public String getContext() { return PreferencesFactory.get().getProperty("openstack.authentication.context"); } }
/** * @return The login secret */ public String getPassword() { if(StringUtils.isEmpty(password)) { if(this.isAnonymousLogin()) { return PreferencesFactory.get().getProperty("connection.login.anon.pass"); } } return password; }
@Override public Local getFile() { return LocalFactory.get(PreferencesFactory.get().getProperty("bookmark.import.cloudberry.azure.location")); } }
@Override public void setTimestamp(final Path file, final Long modified) { final Map<String, String> metadata = PreferencesFactory.get().getMap("b2.metadata.default"); metadata.put(X_BZ_INFO_SRC_LAST_MODIFIED_MILLIS, String.valueOf(modified)); new B2MetadataFeature(session, fileid).setMetadata(file, metadata); } }
private static String resolveAlias(final String absolute) { if(PreferencesFactory.get().getBoolean("local.alias.resolve")) { return resolveAliasNative(absolute); } return absolute; }
@Override public Local getFile() { return LocalFactory.get(PreferencesFactory.get().getProperty("bookmark.import.cloudberry.google.location")); } }
@Override public Map<String, String> getDefault(final Local file) { final Map<String, String> metadata = PreferencesFactory.get().getMap("b2.metadata.default"); metadata.put(X_BZ_INFO_SRC_LAST_MODIFIED_MILLIS, String.valueOf(file.attributes().getModificationDate())); return metadata; }
/** * @return The number of concurrent sessions allowed. -1 if unlimited or null * if the default should be used */ public TransferType getTransferType() { switch(transfer) { case unknown: return Host.TransferType.valueOf(PreferencesFactory.get().getProperty("queue.transfer.type")); } return transfer; }
/** * Use given random as prefix for filename * * @param uid Prefix * @param file Filename */ @Override public Local create(final String uid, final Path file) { return this.create(String.format("%s%s%s", uid, PreferencesFactory.get().getProperty("local.delimiter"), file.getName())); }
public DownloadTransfer(final Host host, final List<TransferItem> roots, final Filter<Path> f, final Comparator<Path> comparator) { super(host, roots, new BandwidthThrottle(PreferencesFactory.get().getFloat("queue.download.bandwidth.bytes"))); this.filter = f; this.comparator = comparator; this.symlinkResolver = new DownloadSymlinkResolver(roots); }
/** * @return temporary file with name in system temporary directory */ @Override public Local create(final String name) { return this.delete(LocalFactory.get(PreferencesFactory.get().getProperty("tmp.dir"), name)); } }
@Override public AbstractUploadFilter filter(final Session<?> session, final Session<?> destination, final TransferAction action, final ProgressListener listener) { return super.filter(session, destination, action, listener).withOptions(new UploadFilterOptions() .withTemporary(PreferencesFactory.get().getBoolean("queue.upload.file.temporary")) .withPermission(PreferencesFactory.get().getBoolean("editor.upload.permissions.change"))); } };
@Override public <T> T serialize(final Serializer dict) { dict.setStringForKey(this.getAbbreviatedPath(), "Path"); // Get or create application scope bookmark final String bookmark = this.getBookmark(); if(StringUtils.isNotBlank(bookmark)) { dict.setStringForKey(bookmark, String.format("%s Bookmark", PreferencesFactory.get().getProperty("application.name"))); } return dict.getSerialized(); }
public static SleepPreventer get() { if(!PreferencesFactory.get().getBoolean("queue.sleep.prevent")) { return new DisabledSleepPreventer(); } return new SleepPreventerFactory().create(); } }
@Override public Permission getDefault(final Local file) { if(PreferencesFactory.get().getBoolean("queue.upload.permissions.default")) { return this.getDefault(file.getType()); } else { // Read permissions from local file return file.attributes().getPermission(); } } }
public DownloadFilterOptions() { final Preferences preferences = PreferencesFactory.get(); segments = preferences.getBoolean("queue.download.segments"); permissions = preferences.getBoolean("queue.download.permissions.change"); timestamp = preferences.getBoolean("queue.download.timestamp.change"); wherefrom = preferences.getBoolean("queue.download.wherefrom"); icon = preferences.getBoolean("queue.download.icon.update"); checksum = preferences.getBoolean("queue.download.checksum.calculate"); }