Package org.syncany.util

Examples of org.syncany.util.NormalizedPath.toFile()


      // Find target path & folder
      NormalizedPath targetPath = findTargetPath();
      NormalizedPath targetFolder = targetPath.getParent();
     
      // Create folder (if necessary) and move file
      if (!targetFolder.toFile().isDirectory()) {
        targetFolder.toFile().mkdirs();
      }
     
      FileUtils.moveFile(cacheFile, targetPath.toFile());
     
View Full Code Here


      NormalizedPath targetPath = findTargetPath();
      NormalizedPath targetFolder = targetPath.getParent();
     
      // Create folder (if necessary) and move file
      if (!targetFolder.toFile().isDirectory()) {
        targetFolder.toFile().mkdirs();
      }
     
      FileUtils.moveFile(cacheFile, targetPath.toFile());
     
      return new RestoreFileSystemActionResult(targetPath.toFile());
View Full Code Here

      try {
        conflictedCopyPath = findConflictFilename(conflictingPath);
        logger.log(Level.INFO, "     - Local version conflicts, moving local file "+conflictingPath+" to "+conflictedCopyPath+" ...");

        if (conflictingPath.toFile().isDirectory()) {
          FileUtils.moveDirectory(conflictingPath.toFile(), conflictedCopyPath.toFile());
        }
        else {
          FileUtils.moveFile(conflictingPath.toFile(), conflictedCopyPath.toFile());
        }
       
View Full Code Here

        if (conflictingPath.toFile().isDirectory()) {
          FileUtils.moveDirectory(conflictingPath.toFile(), conflictedCopyPath.toFile());
        }
        else {
          FileUtils.moveFile(conflictingPath.toFile(), conflictedCopyPath.toFile());
        }
       
        // Success!
        break;
      }
View Full Code Here

      throw new RuntimeException("What to do here?!");
    }
   
    // Try moving file to final destination
    try {
      FileUtils.moveFile(reconstructedFileInCache, targetPath.toFile());
    }
    catch (FileExistsException e) {
      moveToConflictFile(targetPath);
    }
    catch (Exception e) {
View Full Code Here

    }
    catch (Exception e) {
      throw new RuntimeException("What to do here?!");
    }   
   
    return targetPath.toFile();
  }

  protected void createFolder(NormalizedPath targetDir) throws Exception {   
    if (!FileUtil.exists(targetDir.toFile())) {
      logger.log(Level.INFO, "     - Creating folder at " + targetDir.toFile() + " ...");
View Full Code Here

        logger.log(Level.INFO, "     - Had illegal chars, cleaned to "+targetDirPath);
      }

      // Try creating it
      createFolder(targetDirPath);
      setFileAttributes(targetFileVersion, targetDirPath.toFile());
    }
    catch (Exception e) {
      throw new RuntimeException("What to do here?!", e);
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.