org.apache.cassandra.io.util.FileUtils.getCanonicalPath()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(179)

本文整理了Java中org.apache.cassandra.io.util.FileUtils.getCanonicalPath()方法的一些代码示例,展示了FileUtils.getCanonicalPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.getCanonicalPath()方法的具体详情如下:
包路径:org.apache.cassandra.io.util.FileUtils
类名称:FileUtils
方法名:getCanonicalPath

FileUtils.getCanonicalPath介绍

暂无

代码示例

代码示例来源:origin: jsevellec/cassandra-unit

private static String absolutePath(String baseFilename)
{
  return FileUtils.getCanonicalPath(baseFilename + Component.separator);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

/** 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);
}

代码示例来源:origin: jsevellec/cassandra-unit

/** 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);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

/** 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);
}

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

/** 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);
}

代码示例来源:origin: jsevellec/cassandra-unit

/** 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();
  }
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

/** 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();
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

public String getCommitLogLocation()
{
  return FileUtils.getCanonicalPath(DatabaseDescriptor.getCommitLogLocation());
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public String getSavedCachesLocation()
{
  return FileUtils.getCanonicalPath(DatabaseDescriptor.getSavedCachesLocation());
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public String[] getAllDataFileLocations()
{
  String[] locations = DatabaseDescriptor.getAllDataFileLocations();
  for (int i = 0; i < locations.length; i++)
    locations[i] = FileUtils.getCanonicalPath(locations[i]);
  return locations;
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public String[] getAllDataFileLocations()
{
  String[] locations = DatabaseDescriptor.getAllDataFileLocations();
  for (int i = 0; i < locations.length; i++)
    locations[i] = FileUtils.getCanonicalPath(locations[i]);
  return locations;
}

代码示例来源:origin: jsevellec/cassandra-unit

public String[] getAllDataFileLocations()
{
  String[] locations = DatabaseDescriptor.getAllDataFileLocations();
  for (int i = 0; i < locations.length; i++)
    locations[i] = FileUtils.getCanonicalPath(locations[i]);
  return locations;
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public String[] getAllDataFileLocations()
{
  String[] locations = DatabaseDescriptor.getAllDataFileLocations();
  for (int i = 0; i < locations.length; i++)
    locations[i] = FileUtils.getCanonicalPath(locations[i]);
  return locations;
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public String getCommitLogLocation()
{
  return FileUtils.getCanonicalPath(DatabaseDescriptor.getCommitLogLocation());
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public String getSavedCachesLocation()
{
  return FileUtils.getCanonicalPath(DatabaseDescriptor.getSavedCachesLocation());
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

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));
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

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));
  }
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

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));
  }
}

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public static LogRecord make(Type type, SSTable table)
{
  String absoluteTablePath = FileUtils.getCanonicalPath(table.descriptor.baseFilename());
  return make(type, getExistingFiles(absoluteTablePath), table.getAllFilePaths().size(), absoluteTablePath);
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

public void maybeIncrementallyBackup(final SSTableReader sstable)
{
  if (!DatabaseDescriptor.isIncrementalBackupsEnabled())
    return;
  File backupsDir = Directories.getBackupsDirectory(sstable.descriptor);
  sstable.createLinks(FileUtils.getCanonicalPath(backupsDir));
}

相关文章