Package java.io

Examples of java.io.File.createNewFile()


     
      File jpg = new File(graphicsSubDir, "testHipKro03test.jpg");
      jpg.createNewFile();

      File png = new File(graphicsSubDir, "testHipKro03test.png");
      png.createNewFile();
     
    } catch (Exception e) {
      throw new RuntimeException();
    }
  }
View Full Code Here


        pPAttachment.setFileName(lFile.getName());
      }

      File lF = pPAttachment.getFile();
      if (!lF.exists()) {
        lF.createNewFile();
        lInspect = false;
      }

      // --- File Inspection.
      // CB FIXME Do we have to inspect only after redirect?
View Full Code Here

    File dbFormatFile = getDBFormatFile();
    File migFormatFile = new File(dbFormatFile.getAbsolutePath() + ".mig");
    try {
      if (!migFormatFile.exists()) {
        migFormatFile.createNewFile();
      }
      if (!dbFormatFile.exists()) {
        dbFormatFile.createNewFile();
      }
    } catch (IOException ioe) {
View Full Code Here

     * In case there is no database file, we just set the version as the current
     * version.
     */
    if (!formatFileExists) {
      try {
        formatFile.createNewFile();
      } catch (IOException ioe) {
        throw new PersistenceException("Error creating database", ioe); //$NON-NLS-1$
      }
    }
    setFormatVersion(formatFile);
View Full Code Here

        Exception ex = null;
        try
        {
            tmpDir = tmpDir.getCanonicalFile();
            File tempFile = new File( tmpDir, "wrapper-" + System.currentTimeMillis() + "-" + getJavaPID() );
            if ( tempFile.createNewFile() )
            {
                if ( !tempFile.delete() )
                {
                    m_outError.println( "Unable to delete temporary file: " + tempFile );
                }
View Full Code Here

            if (len > 0)
              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

    String trackPath = pFolder + File.separator + pFileName;
    File trackFile = new File(trackPath);
    if (pCreateOnDisk) {
      if (!trackFile.exists()) {
        try {
          if (!trackFile.createNewFile()) {
            throw new DownloadException(trackFile.getName());
          }
        } catch (IOException e) {
          throw new DownloadException(e.getMessage());
        }
View Full Code Here

public class ExcelItemWriterTest {

  public void testWrite() throws IOException {
    File file = new File("src/test/resources/tmp.xls");
    if (!file.exists()) {
      file.createNewFile();
    }
    ExcelItemWriter writer = new ExcelItemWriter(new FileOutputStream(file));
    writer.writeTitle("人员信息", new String[] { "姓名", "性别", "身份证号", "政治面貌" });
    writer.write(new String[] { "张三", "男", "xxxx", "无党派人士" });
    writer.close();
View Full Code Here

    configure();
    File dbExistsFile = getDBExistsFile();
    boolean dbExists = dbExistsFile.exists();
    if (!dbExists) {
      try {
        dbExistsFile.createNewFile();
      } catch (IOException ioe) {
        throw new DBException(Activator.getDefault().createErrorStatus(
            "Error creating database", ioe)); //$NON-NLS-1$
      }
    }
View Full Code Here

    File dbFormatFile = getDBFormatFile();
    File migFormatFile = new File(dbFormatFile.getAbsolutePath() + ".mig.temp"); //$NON-NLS-1$
    try {
      if (!migFormatFile.exists()) {
        migFormatFile.createNewFile();
      }
      if (!dbFormatFile.exists()) {
        dbFormatFile.createNewFile();
      }
    } catch (IOException ioe) {
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.