Пример #1
0
 public String getRealFileName() {
   if (getFileName().endsWith(Settings.getTmpExtension())) {
     return getFileNameWithoutExtension();
   } else {
     return getFileName();
   }
 }
Пример #2
0
  public File getDownloadTargetFile() throws FileNotFoundException, IOException {
    File file = new File(Settings.getSharedFolder() + getFileName() + Settings.getTmpExtension());

    if (!file.exists() /* && getCompleteFile() == null TODO activate */) {
      file.createNewFile();
      RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw");
      randomAccessFile.setLength(getFileSize());
      randomAccessFile.close();
    }

    if (file.exists()) return file;

    return null;
  }