Examples of createNewFile()


Examples of java.io.File.createNewFile()

            if ((recoverFlag == LogRecord.REDO) && (operationFlag == FILE_NEW_OPERATION) && (!existFlag)) {
                /* renew the file or recreate the directory */
                if (fileOrDirFlag == DIRECTORY_FLAG) {
                    file.mkdirs();
                } else {
                    file.createNewFile();
                }
            } else
            if (((recoverFlag == LogRecord.REDO) && (operationFlag == FILE_DELETE_OPERATION) && existFlag) || ((recoverFlag == LogRecord.UNDO) && (((operationFlag == FILE_NEW_OPERATION) && existFlag) || (operationFlag == FILE_DELETE_OPERATION) || (operationFlag == FILE_UPDATE_OPE_BYTE)))) {
                /* modified by marriane for close btree while delete
                directory or file */
 
View Full Code Here

Examples of java.io.File.createNewFile()

        File path = new File(documentRoot, constructed);
        path.mkdirs();
        String identifier = System.currentTimeMillis() + "_" + StringUtils.getFilename(document.getIdentifier());
        document.setUri(constructed + "/" + identifier);
        path = new File(path, identifier);
        path.createNewFile();
        return new FileOutputStream(path);
    }

    public boolean delete(String uri) {
        Assert.hasText(uri);
View Full Code Here

Examples of java.io.File.createNewFile()

            boolean status = testCaseList.delete();
            assert (status) : "delete file failed: " + testCaseList.getAbsolutePath();
        }
        testCaseList = new File(testResourceDir, "TestCase.list");
        assert (!testCaseList.exists());
        boolean created = testCaseList.createNewFile();
        assert (created) : "File creation failed: " + testCaseList.getAbsolutePath();
    }

    private static void generate() throws Exception {
        final Document catalog = XQTSTestBase.catalogPool.borrowObject();
View Full Code Here

Examples of java.io.File.createNewFile()

public class DeleteOnCloseFileInputStreamTest extends TestCase {
  public void testIt() throws Exception {
    String property = System.getProperty("java.io.tmpdir");
    File tempFile = new File(property, getClass().getName());
    assertTrue(tempFile.createNewFile());
    DeleteOnCloseFileInputStream is = new DeleteOnCloseFileInputStream(tempFile);
    is.close();
    assertFalse("file was not deleted.", tempFile.exists());
  }
}
View Full Code Here

Examples of java.io.File.createNewFile()

        if (outputFile != null) {
            File oFile = new File(outputFile);
           
            try {
                if(!oFile.exists()){
                    oFile.createNewFile();
                }
                if (oFile.canWrite()) {
                    outWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(oFile)));
                }
            } catch (FileNotFoundException e) {
View Full Code Here

Examples of java.io.File.createNewFile()

        }
        if (errFile != null) {
            File eFile = new File(errFile);
            try {
                if(!eFile.exists()){
                    eFile.createNewFile();
                }
                if (eFile.canWrite()) {
                    errWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(eFile)));
                }
            } catch (FileNotFoundException e) {
View Full Code Here

Examples of java.io.File.createNewFile()

    }
    // So, f is a file
    if (dest.isDirectory()) {
      // Create a new file of that name in the empty directory
      File newFile = new File(dest, src.getName());
      newFile.createNewFile();
      // Use copy in the last case : file to file
      copy(src,newFile);
      return;
    }
    try {
View Full Code Here

Examples of java.io.File.createNewFile()

     
      first_run = true;
     
      try {
     
        config_file.createNewFile();
     
      } catch( Throwable cause ) {
       
        throw new JMuleCoreException( cause );
       
View Full Code Here

Examples of java.io.File.createNewFile()

         File lock = null;
         String lockName = null;
         if (this.lockExtention != null) {
            lockName = fileName + this.lockExtention;
            lock = new File(dir, lockName);
            lock.createNewFile();
         }
         log.info("storing file '" + fileName + "' on directory '" + dir + "'");

         File[] files = null;
         long numChunks = 0L;
View Full Code Here

Examples of java.io.File.createNewFile()

     
      // now some which should fail:
      // existing file but not a directory
      File file = new File(this.dirName);
      try {
         file.createNewFile();
      }
      catch (IOException ex) {
         assertTrue("could not create the file '" + this.dirName + "'", false);
      }
     
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.