@Override public Path resolvePermanentFilePath(Path path) { return filesSettings.getPermanentDirectory().resolve(path); } }
private Path getGlobalThemeDirectory(String themeId) { return filesSettings.getPermanentDirectory() .resolve(THEMES_FOLDER_NAME) .resolve(themeId); }
private Path getTenantThemeDirectory(String tenantSlug, String themeId) { return filesSettings.getPermanentDirectory() .resolve(TENANTS_FOLDER_NAME) .resolve(tenantSlug) .resolve(THEMES_FOLDER_NAME) .resolve(themeId); }
/** * @return this gateway global (server-level) configuration file * * @param fileName the name of the file to retrieve */ protected File getGlobalConfigurationFile(String fileName) { return filesSettings.getPermanentDirectory() .resolve(PAYMENTS_DIRECTORY) .resolve(this.getId()) .resolve(fileName).toFile(); }
public FileWatcher(ComponentManager componentManager) throws InitializationException { Preconditions.checkNotNull(componentManager); try { FilesSettings filesSettings = componentManager.getInstance(FilesSettings.class); this.observationManager = componentManager.getInstance(ObservationManager.class); this.permanentDirectory = filesSettings.getPermanentDirectory(); watchService = FileSystems.getDefault().newWatchService(); } catch (ComponentLookupException | IOException e) { throw new InitializationException("Failed to initialize the file watcher.", e); } }
/** * @return this gateway global (server-level) configuration file * * @param fileName the name of the file to retrieve */ protected Optional<File> getTenantConfigurationFile(String fileName) { if (this.context.getTenant() == null) { return Optional.absent(); } return Optional.of(filesSettings.getPermanentDirectory() .resolve(TENANTS_DIRECTORY) .resolve(this.context.getTenant().getSlug()) .resolve(PAYMENTS_DIRECTORY) .resolve(this.getId()) .resolve(fileName).toFile()); }
settings.put("path.data", filesSettings.getPermanentDirectory().toString()); settings.put("client.transport.sniff", true); settings.build();