Package java.io

Examples of java.io.File.deleteOnExit()


        InputStream embeddedWarfile = Launcher.class.getResourceAsStream(
                embeddedWarfileName);
        if (embeddedWarfile != null) {
            File tempWarfile = File.createTempFile("embedded", ".war").getAbsoluteFile();
            tempWarfile.getParentFile().mkdirs();
            tempWarfile.deleteOnExit();

            String embeddedWebroot = RESOURCES.getString("Launcher.EmbeddedWebroot");
            File tempWebroot = new File(tempWarfile.getParentFile(), embeddedWebroot);
            tempWebroot.mkdirs();
           
View Full Code Here


    public static void openRemoteExternalFile(final MetaData metaData,
                                              final String link, final ExternalFileType fileType) {
        File temp = null;
        try {
            temp = File.createTempFile("jabref-link", "."+fileType.getExtension());
            temp.deleteOnExit();
            System.out.println("Downloading to '"+temp.getPath()+"'");
            URLDownload ud = new URLDownload(null, new URL(link), temp);
            ud.download();
            System.out.println("Done");
        } catch (MalformedURLException ex) {
View Full Code Here

                  FileOutputStream out = null;
                  boolean canceled = false;
                  Exception error = null;
                  try {
                    tmpFile = File.createTempFile("feed", ".txt"); //$NON-NLS-1$ //$NON-NLS-2$
                    tmpFile.deleteOnExit();

                    byte[] buffer = new byte[8192];

                    in = handler.openStream(feedLink, monitor, null);
                    out = new FileOutputStream(tmpFile);
View Full Code Here

  protected File createTempFile(String filename)
  {
    try {
      // TODO should preserve extension of downloaded file
      File tempFile = File.createTempFile("jhylafax", null);
      tempFile.deleteOnExit();
      return tempFile;
    }
    catch (IOException e) {
      logger.debug("Error creating temporary file", e);
      JHylaFAX.getInstance().showError(i18n.tr("Error creating temporary file"), e);
View Full Code Here

              contentLength = len;
          }

          /* Create tmp part File */
          partFile.createNewFile();
          partFile.deleteOnExit();

          /* Keep Outputstream for later */
          out = new FileOutputStream(partFile);
          fOutputStreamMap.put(out, out);

View Full Code Here

  public static String createSQLFile(List<String> sqls, boolean deleteOnExit) throws IOException
  {
    File f = File.createTempFile("test", ".sql");
    if (deleteOnExit)
    {
      f.deleteOnExit();
    }
    PrintWriter out = new PrintWriter(new FileWriter(f));
    for (String sql : sqls)
    {
      out.println(sql);
View Full Code Here

                    .read(array)) {
                outputStream.write(array, 0, i);
            }

            outputStream.close();
            temporaryDll.deleteOnExit();
            com.valhalla.Logger.debug(temporaryDll.getPath());
            return temporaryDll.getPath();
        } catch (Exception ex) {
            com.valhalla.Logger.logException(ex);
            return null;
View Full Code Here

        }
      }

      private void writeTempFile(AtomicBoolean canUpdate, File dir) throws IOException {
        File tmpFile = File.createTempFile("permcheck", ".tmp", dir); //$NON-NLS-1$ //$NON-NLS-2$
        tmpFile.deleteOnExit();
        canUpdate.set(tmpFile.exists() && tmpFile.canWrite());
        tmpFile.delete();
      }
    });
View Full Code Here

    File tempFile = null;
    FileWriter fwriter = null;

    try {
      tempFile = File.createTempFile("csvWriterTest", ".csv");
      tempFile.deleteOnExit();
      fwriter = new FileWriter(tempFile);
      writer = new CsvWriter(fwriter);
    } catch (IOException e) {
    }
View Full Code Here

    IPath backupTmpPath = rootPath.append(BACKUP_TMP);
    IPath weeklyBackupPath = rootPath.append(WEEKLY_BACKUP);

    File dailyBackupFile = dailyBackupPath.toFile();
    File backupTmpFile = backupTmpPath.toFile();
    backupTmpFile.deleteOnExit();
    File weeklyBackupFile = weeklyBackupPath.toFile();

    if (dailyBackupFile.exists()) {

      /* Update Weekly Backup if required */
 
View Full Code Here

TOP
Copyright © 2015 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.