Package java.io

Examples of java.io.File.createNewFile()


        return;
      }
    }
   
    File dialogFile = new File(dialogSubDir.toString() + File.separator + dialogName);
    dialogFile.createNewFile();
  }
 
  /**
   * For a named dialog, if the user has opted not to view it again,
   * returns the answer the answer the user supplied when they
View Full Code Here


          Thread.sleep(10);
        } catch (InterruptedException e) {
          break;
        }
      }
      else if(f.createNewFile()){
        FileOutputStream fos = new FileOutputStream(f);
        try{
          mail.writeTo(fos);
          return f.getPath();
        }finally{
View Full Code Here

    void saveLayout() throws IOException {
        File file = getLayoutFile();
        if (file != null) {
            if (!file.exists()) {
                if (!file.createNewFile()) {
                    return;
                }
            }
            if (file.canWrite()) {
                FileOutputStream output = new FileOutputStream(file);
View Full Code Here

    }

    private void testFutureModificationDate() throws Exception {
        File f = new File(getFile());
        f.delete();
        f.createNewFile();
        f.setLastModified(System.currentTimeMillis() + 10000);
        FileLock lock = new FileLock(new TraceSystem(null), getFile(), Constants.LOCK_SLEEP);
        lock.lock(FileLock.LOCK_FILE);
        lock.unlock();
    }
View Full Code Here

     * @since 4.3
     */
    public void testCopyRecursivelyNull() throws Exception {
        File fileSource = new File(TEMP_FILE_NAME);
        fileSource.delete();
        fileSource.createNewFile();
        try {
            FileUtils.copyDirectoriesRecursively(fileSource, fileSource);
            fail("File arg should have been illegal."); //$NON-NLS-1$
        } catch (final Exception err) {
            // source was a file instead of dir - exception
View Full Code Here

       
        //try to create a file
        File tmpFile = new File(dirPath + File.separatorChar + TEMP_FILE);
        boolean success = false;
        try {
            success = tmpFile.createNewFile();
        } catch (IOException e) {
        }
        if (!success) {
            final String msg = CorePlugin.Util.getString("FileUtils.Unable_to_create_file_in", dirPath); //$NON-NLS-1$           
            throw new TeiidException(msg);
View Full Code Here

            // TODO FIXME
            //throw new IllegalStateException("lock file already exists: " + lockFile.getAbsolutePath());
        }
        final boolean created;
        try {
            created = lockFile.createNewFile();
        } catch (IOException e) {
            throw new IllegalStateException("Creation of the lock file failed", e);
        }
        assert (created);
        this.lockFilePath = lockFile.getAbsolutePath();
View Full Code Here

    p.put("download.ignore.paths", downloadIgnorePath.getText());
   
   
    try {
      File f = new File("config.properties");
      f.createNewFile();
      p.store(new FileOutputStream(f), "Everbox4j Config");
      JOptionPane.showConfirmDialog(frmEverbox,
          "保存成功!! 如果你改变了用户名,请先退出客户端,然后再启动!","提醒",JOptionPane.OK_OPTION);
    } catch (Throwable e) {
      log.error("保存出错!!", e);
View Full Code Here

      uploadResources.put(upResource.getUploadId(), upResource);

      File fileStore = new File(upResource.getStoreLocation());
      if (!fileStore.exists())
         fileStore.createNewFile();
      FileOutputStream output = new FileOutputStream(fileStore);
      reader.readBodyData(request, output);

      if (upResource.getStatus() == UploadResource.UPLOADING_STATUS)
      {
View Full Code Here

      upResource.setStoreLocation(uploadLocation_ + "/" + uploadId + "." + fileName);
      upResource.setEstimatedSize(contentLength);
      uploadResources.put(upResource.getUploadId(), upResource);
      File fileStore = new File(upResource.getStoreLocation());
      if (!fileStore.exists())
         fileStore.createNewFile();
      FileOutputStream output = new FileOutputStream(fileStore);
      reader.readBodyData(inputStream, contentType, output);

      if (upResource.getStatus() == UploadResource.UPLOADING_STATUS)
      {
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.