Пример #1
0
 public static String getTrueCryptExe() throws ExceptionInInitializerError {
   if (SystemUtils.IS_OS_WINDOWS) {
     String s = Configuration.getProperty("truecrypt.home.dir");
     if (s != null && s.length() > 0 && !s.contains("\"")) {
       File f = new File(s);
       if (f.isDirectory() && f.exists()) {
         String tcexe = f.getAbsolutePath() + "/TrueCrypt.exe";
         File tc = new File(tcexe);
         if (tc.isFile() && tc.exists()) {
           return tc.getAbsolutePath();
         }
       }
     }
     throw new ExceptionInInitializerError("Error finding TrueCrypt in " + s);
   }
   if (SystemUtils.IS_OS_LINUX) {
     String tc = "/usr/bin/truecrypt";
     File f = new File(tc);
     if (f.exists()) {
       return "/usr/bin/truecrypt";
     }
     throw new ExceptionInInitializerError("Error finding TrueCrypt in /usr/bin/");
   }
   throw new ExceptionInInitializerError("Unsupported operating system");
 }
Пример #2
0
  /**
   * Returns a list of all supported drive letters which have been configured to be used for
   * mounting TrueCrypt files. See backmeup.indexer.properties This does not state that a given
   * drive or volume is already in use or not
   */
  public static List<String> getSupportedDriveLetters() {
    if (SystemUtils.IS_OS_LINUX) {
      return generateSupportedDrivesForLinux();
    }

    if (SystemUtils.IS_OS_WINDOWS) {
      return Configuration.getPropertyList("truecrypt.mountable.drives");
    }

    return new ArrayList<>();
  }