private static String absolutePath(String baseFilename) { return FileUtils.getCanonicalPath(baseFilename + Component.separator); }
/** Return true if file is contained in folder */ public static boolean isContained(File folder, File file) { String folderPath = getCanonicalPath(folder); String filePath = getCanonicalPath(file); return filePath.startsWith(folderPath); }
/** Return true if file is contained in folder */ public static boolean isContained(File folder, File file) { String folderPath = getCanonicalPath(folder); String filePath = getCanonicalPath(file); return filePath.startsWith(folderPath); }
/** Return true if file is contained in folder */ public static boolean isContained(File folder, File file) { String folderPath = getCanonicalPath(folder); String filePath = getCanonicalPath(file); return filePath.startsWith(folderPath); }
/** Return true if file is contained in folder */ public static boolean isContained(File folder, File file) { String folderPath = getCanonicalPath(folder); String filePath = getCanonicalPath(file); return filePath.startsWith(folderPath); }
/** Convert absolute path into a path relative to the base path */ public static String getRelativePath(String basePath, String path) { try { return Paths.get(basePath).relativize(Paths.get(path)).toString(); } catch(Exception ex) { String absDataPath = FileUtils.getCanonicalPath(basePath); return Paths.get(absDataPath).relativize(Paths.get(path)).toString(); } }
/** Convert absolute path into a path relative to the base path */ public static String getRelativePath(String basePath, String path) { try { return Paths.get(basePath).relativize(Paths.get(path)).toString(); } catch(Exception ex) { String absDataPath = FileUtils.getCanonicalPath(basePath); return Paths.get(absDataPath).relativize(Paths.get(path)).toString(); } }
public String getCommitLogLocation() { return FileUtils.getCanonicalPath(DatabaseDescriptor.getCommitLogLocation()); }
public String getSavedCachesLocation() { return FileUtils.getCanonicalPath(DatabaseDescriptor.getSavedCachesLocation()); }
public String[] getAllDataFileLocations() { String[] locations = DatabaseDescriptor.getAllDataFileLocations(); for (int i = 0; i < locations.length; i++) locations[i] = FileUtils.getCanonicalPath(locations[i]); return locations; }
public String[] getAllDataFileLocations() { String[] locations = DatabaseDescriptor.getAllDataFileLocations(); for (int i = 0; i < locations.length; i++) locations[i] = FileUtils.getCanonicalPath(locations[i]); return locations; }
public String[] getAllDataFileLocations() { String[] locations = DatabaseDescriptor.getAllDataFileLocations(); for (int i = 0; i < locations.length; i++) locations[i] = FileUtils.getCanonicalPath(locations[i]); return locations; }
public String[] getAllDataFileLocations() { String[] locations = DatabaseDescriptor.getAllDataFileLocations(); for (int i = 0; i < locations.length; i++) locations[i] = FileUtils.getCanonicalPath(locations[i]); return locations; }
public String getCommitLogLocation() { return FileUtils.getCanonicalPath(DatabaseDescriptor.getCommitLogLocation()); }
public String getSavedCachesLocation() { return FileUtils.getCanonicalPath(DatabaseDescriptor.getSavedCachesLocation()); }
public void maybeIncrementallyBackup(final Iterable<SSTableReader> sstables) { if (!DatabaseDescriptor.isIncrementalBackupsEnabled()) return; for (SSTableReader sstable : sstables) { File backupsDir = Directories.getBackupsDirectory(sstable.descriptor); sstable.createLinks(FileUtils.getCanonicalPath(backupsDir)); } }
public void maybeIncrementallyBackup(final Iterable<SSTableReader> sstables) { if (!DatabaseDescriptor.isIncrementalBackupsEnabled()) return; for (SSTableReader sstable : sstables) { File backupsDir = Directories.getBackupsDirectory(sstable.descriptor); sstable.createLinks(FileUtils.getCanonicalPath(backupsDir)); } }
public void maybeIncrementallyBackup(final Iterable<SSTableReader> sstables) { if (!DatabaseDescriptor.isIncrementalBackupsEnabled()) return; for (SSTableReader sstable : sstables) { File backupsDir = Directories.getBackupsDirectory(sstable.descriptor); sstable.createLinks(FileUtils.getCanonicalPath(backupsDir)); } }
public static LogRecord make(Type type, SSTable table) { String absoluteTablePath = FileUtils.getCanonicalPath(table.descriptor.baseFilename()); return make(type, getExistingFiles(absoluteTablePath), table.getAllFilePaths().size(), absoluteTablePath); }
public void maybeIncrementallyBackup(final SSTableReader sstable) { if (!DatabaseDescriptor.isIncrementalBackupsEnabled()) return; File backupsDir = Directories.getBackupsDirectory(sstable.descriptor); sstable.createLinks(FileUtils.getCanonicalPath(backupsDir)); }