Exemple #1
0
 File openExistingFile(@NotNull final String name, final boolean throwFileNotFound) {
   final File result = vfs.openFile(env.getAndCheckCurrentTransaction(), name, false);
   if (throwFileNotFound && result == null) {
     throw new FileNotFoundException(name);
   }
   return result;
 }
Exemple #2
0
 @Override
 public String[] listAll() throws IOException {
   final Transaction txn = env.getAndCheckCurrentTransaction();
   final ArrayList<String> allFiles = new ArrayList<>((int) vfs.getNumberOfFiles(txn));
   for (final File file : vfs.getFiles(txn)) {
     allFiles.add(file.getPath());
   }
   return allFiles.toArray(new String[allFiles.size()]);
 }
Exemple #3
0
 @Override
 public long fileLength(String name) throws IOException {
   return vfs.getFileLength(env.getAndCheckCurrentTransaction(), openExistingFile(name, true));
 }
Exemple #4
0
 @Override
 public void deleteFile(String name) throws IOException {
   vfs.deleteFile(env.getAndCheckCurrentTransaction(), name);
 }
Exemple #5
0
 @Override
 public void touchFile(String name) throws IOException {
   vfs.touchFile(env.getAndCheckCurrentTransaction(), openExistingFile(name, true));
 }