Examples of createNewFile()


Examples of java.io.File.createNewFile()

    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

Examples of java.io.File.createNewFile()

      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

Examples of java.io.File.createNewFile()

      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

Examples of java.io.File.createNewFile()

  private BufferedWriter getBufferedWriter() throws IOException {
    File file = new File(path, name + "."
        + LogFactory.dayDateFormat.format(new Date()) + ".txt");
    boolean ret = false;
    if (!file.exists()) {
      ret = file.createNewFile();
    } else {
      ret = true;
    }
    if (ret)
      return new BufferedWriter(new FileWriter(file, true));
View Full Code Here

Examples of java.io.File.createNewFile()

  if (summaryFile.exists() && !overwrite) {
      throw new IOException(
        "Summary file already exists: " + summaryFile.getName()); //$NON-NLS-1$
  }
  try {
      summaryFile.createNewFile();
  } catch (IOException ioe) {
      TestLogger.log("Error creating new summary file: "
        + summaryFile.getAbsolutePath());
      throw ioe;
  }
View Full Code Here

Examples of java.io.File.createNewFile()

      throw new IOException(
        "Summary file already exists: " + summaryFile.getName()); //$NON-NLS-1$
  }

  try {
      summaryFile.createNewFile();
  } catch (IOException e) {
      System.err
        .println("Failed to create summary file at: " + summaryFile.getAbsolutePath()); //$NON-NLS-1$
      throw new IOException(
        "Failed to create summary file at: " + summaryFile.getAbsolutePath() + ": " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

Examples of java.io.File.createNewFile()

          BufferedWriter out = new BufferedWriter(fstream);

  if (!exists) {

          try {
              summaryFile.createNewFile();
          } catch (IOException e) {
              System.err
                .println("Failed to create overall summary file at: " + summaryFile.getAbsolutePath()); //$NON-NLS-1$
              throw new IOException(
                "Failed to create overall summary file at: " + summaryFile.getAbsolutePath() + ": " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

Examples of java.io.File.createNewFile()

        BufferedWriter out = new BufferedWriter(fstream);

        if (!exists) {

            try {
          summaryFile.createNewFile();
            } catch (IOException e) {
          System.err
        .println("Failed to create overall summary error file at: " + summaryFile.getAbsolutePath()); //$NON-NLS-1$
          throw new IOException(
        "Failed to create overall summary error file at: " + summaryFile.getAbsolutePath() + ": " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

Examples of java.io.File.createNewFile()

      if (fis == null || fis.available() < 0) {
        return;
      }
      fl = new File(this.fullWorkingPath + fileName);

      if (!fl.createNewFile()) {
        throw new CvFileException(CvFileException.COULD_NOT_CREATE_DIRECTORY, "Could not create file");
      }

      fos = new FileOutputStream(fl);
View Full Code Here

Examples of java.io.File.createNewFile()

        assertEquals(0, testFile.length());
    }

    public void testStoreWithExistingFile() throws Exception {
        File testFile = new File(ROOT_DIR, TEST_FILENAME);
        testFile.createNewFile();

        assertTrue(testFile.exists());
        assertEquals(0, testFile.length());

        assertTrue(client.storeFile(TEST_FILENAME, new ByteArrayInputStream(
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.