コード例 #1
0
 @Override
 public void deleteFileAtPath(Path path) throws IOException {
   if (exists(path)) {
     rmFile(path);
   } else {
     throw new NoSuchFileException(path.toString());
   }
 }
コード例 #2
0
 @Override
 public boolean deleteFileAtPathIfExists(Path path) throws IOException {
   if (exists(path)) {
     rmFile(path);
     return true;
   } else {
     return false;
   }
 }
コード例 #3
0
 @Override
 public void createSymLink(Path symLink, Path realFile, boolean force) throws IOException {
   if (!force) {
     if (fileContents.containsKey(symLink) || directories.contains(symLink)) {
       throw new FileAlreadyExistsException(symLink.toString());
     }
   } else {
     rmFile(symLink);
     deleteRecursivelyIfExists(symLink);
   }
   symLinks.put(symLink, realFile);
 }