Examples of createNewFile()


Examples of java.io.File.createNewFile()

    }

    public void testStoreUniqueWithCompletePath() throws Exception {
        TEST_DIR.mkdirs();
        File existingFile = new File(TEST_DIR, "existingFile.txt");
        existingFile.createNewFile();

        assertTrue(client.storeUniqueFile("foo/bar/existingFile.txt",
                new ByteArrayInputStream(testData)));

        doAssertOfUniqueFile(client, ROOT_DIR);
View Full Code Here

Examples of java.io.File.createNewFile()

    protected abstract ISettingsFileSearchStrategy getStrategy();

    protected File createSettingsFile(File dir) {
        File file = new File(dir, Settings.DEFAULT_SETTINGS_FILE);
        try {
            file.createNewFile();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        file.deleteOnExit();
        return file;
View Full Code Here

Examples of java.io.File.createNewFile()


  private static void makeEmpty( final String filename ) throws IOException {
    final File file = new File( filename );
    if ( file.exists() && !file.delete() ) throw new IOException( "Cannot delete file " + file );
    file.createNewFile();
  }

  /**
   * Closes this pass, releasing all resources.
   */
 
View Full Code Here

Examples of java.io.File.createNewFile()

       
        target.getFile().delete();
        File file = new File(filename);
       
        try {
            file.createNewFile();
       
            definition.setFile(file);
            settingsPanel.saveSettings(definition.getSettings(), false);
        } catch (IOException ie) {
            throw new WizardException(DcResources.getText("msgFileCannotBeUsed"));
View Full Code Here

Examples of java.io.File.createNewFile()

       
        File file = new File(dir, "temp.txt");
        try {
       
            if (!file.exists())
                file.createNewFile();
           
            if (!file.exists() || !file.canWrite())
                throw new IOException("File cannot be created in directory " + dir);

        } catch (Throwable e) {
View Full Code Here

Examples of java.io.File.createNewFile()

            queryFile.delete();
            queryFile = new File(DataCrow.dataDir, "data_crow_queries.txt");
        }

        try {
            queryFile.createNewFile();
            RandomAccessFile access  = new RandomAccessFile(queryFile, "rw");

            for (int i = 0; i < comboSQLCommands.getItemCount(); i++) {
                Object o = comboSQLCommands.getItemAt(i);
                if (o != null && o instanceof QueryObject) {
View Full Code Here

Examples of java.io.File.createNewFile()

    public boolean createNewFile(String fileName) {
        fileName = translateFileName(fileName);
        File file = new File(fileName);
        for (int i = 0; i < SysProperties.MAX_FILE_RETRY; i++) {
            try {
                return file.createNewFile();
            } catch (IOException e) {
                // 'access denied' is really a concurrent access problem
                wait(i);
            }
        }
View Full Code Here

Examples of java.io.File.createNewFile()

        ((FTPSClient) client).execPROT("P");
        assertTrue(getActiveSession().getDataConnection().isSecure());

        File file = new File(ROOT_DIR, "foo");
        file.createNewFile();

        InputStream is = null;
        try {
            is = client.retrieveFileStream(file.getName());
            assertEquals(-1, is.read(new byte[1024]));
View Full Code Here

Examples of java.io.File.createNewFile()

        HTMLProfileReport report = new HTMLProfileReport(buildProfile);
        File file = new File(result.getGradle().getRootProject().getBuildDir(), "reports/profile/profile-"+
                FILE_DATE_FORMAT.format(new Date(profileStarted)) + ".html" );
        file.getParentFile().mkdirs();
        try {
            file.createNewFile();
            report.writeTo(file);
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
View Full Code Here

Examples of java.io.File.createNewFile()

        public DescriptorRAF(File baseFile, int cacheSize) throws IOException {
            String descName = baseFile.getName() + DESCRIPTOR_APPENDIX_RAF;
            File descFile = new File(baseFile.getParent(), descName);
            if(!descFile.exists()) {
                boolean created = descFile.createNewFile();
                if(!created) {
                    throw new IllegalStateException("create file failed: "
                            + descFile.getAbsolutePath());
                }
            }
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.