Examples of createNewFile()


Examples of java.io.File.createNewFile()

  /** debug */
  static void make(DiskCache2 dc, String filename) throws IOException {
    File want = dc.getCacheFile(filename);
    System.out.println("make=" + want.getPath() + "; exists = " + want.exists());
    if (!want.exists())
      want.createNewFile();
    System.out.println(" canRead= " + want.canRead() + " canWrite = " + want.canWrite() + " lastMod = " + new Date(want.lastModified()));

    String enc = EscapeStrings.urlEncode(filename);
    System.out.println(" original=" + EscapeStrings.urlDecode(enc));
    /* try {
View Full Code Here

Examples of java.io.File.createNewFile()

    // create and test write permissions
    fidx = new File(gribName + currentSuffix);
    // now comes the tricky part to make sure we can open and write to it
    try {
      if (fidx.createNewFile()) {
        fidx.delete();
        return fidx.getPath();
      }
    } catch (IOException e) {
      // cant write to it - drop through
View Full Code Here

Examples of jcifs.smb.SmbFile.createNewFile()

    public SMBFSEntry addFile(final String name) throws IOException {
        try {
            return AccessController.doPrivileged(new PrivilegedExceptionAction<SMBFSEntry>() {
                public SMBFSEntry run() throws Exception {
                    SmbFile file = new SmbFile(smbFile, name);
                    file.createNewFile();
                    SMBFSFile sfile = new SMBFSFile(SMBFSDirectory.this, file);
                    entries.put(name, sfile);
                    return sfile;
                }
            });
View Full Code Here

Examples of lombok.val.createNewFile()

      if (!file.isFile())
        throw new FileNotFoundException("The specified path is not referring to a file: " + fileAbsPath);

      // set to current date/time (millis since 1/1/1970)
      file.setLastModified(System.currentTimeMillis());
    } else if (!file.createNewFile())
      throw new IOException("Could not touch file, because creation of new file failed.");
  }

  /**
   * Touches a file, i.e. creates it if not there, otherwise updates its last write time. Returns true if succeeded. No exception is thrown
View Full Code Here

Examples of net.raymanoz.io.File.createNewFile()

      properties.setProperty(UMIGRATE_SCRIPT_NAME_PROPERTY, nextScriptName);
      ParameteriserImpl.transferParameteriserProperties(configuration.uMigrateProperties(), properties);
      assembler.newFileUtil().copyFile(configuration.getTemplateFile(), nextScript, properties, prefixConditions);
    } else {
      try {
        nextScript.createNewFile();
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    System.out.println("***************");
 
View Full Code Here

Examples of org.apache.accumulo.server.fs.VolumeManager.createNewFile()

      files.add(entry);
    }
    log.debug("tid " + tid + " importing " + files.size() + " files");

    Path writable = new Path(this.errorDir, ".iswritable");
    if (!fs.createNewFile(writable)) {
      // Maybe this is a re-try... clear the flag and try again
      fs.delete(writable);
      if (!fs.createNewFile(writable))
        throw new ThriftTableOperationException(tableId, null, TableOperation.BULK_IMPORT, TableOperationExceptionType.BULK_BAD_ERROR_DIRECTORY,
            "Unable to write to " + this.errorDir);
View Full Code Here

Examples of org.apache.derby.impl.io.vfmem.VirtualFile.createNewFile()

        VirtualFile tmp = new VirtualFile(PathUtilTest.abs("directory"), store);
        assertTrue(tmp.mkdir());
        tmp = new VirtualFile(
                PathUtilTest.joinAbs("directory", "afile"),
                store);
        assertTrue(tmp.createNewFile());
        assertTrue(tmp.exists());
        assertFalse(tmp.isDirectory());
        VirtualFile vFile = new VirtualFile(
                PathUtilTest.joinAbs("directory", "afile", "anotherdir"),
                store);
View Full Code Here

Examples of org.apache.hadoop.fs.FileSystem.createNewFile()

      for (long fid = 0; (System.currentTimeMillis() - startTime) < TEST_TIME; ++fid) {
        Path file = new Path(familyDir,  String.valueOf(fid));
        Path sourceFile = new Path(rootDir, file);
        Path archiveFile = new Path(archiveDir, file);

        fs.createNewFile(sourceFile);

        try {
          // Try to archive the file
          HFileArchiver.archiveRegion(fs, rootDir,
              sourceRegionDir.getParent(), sourceRegionDir);
View Full Code Here

Examples of org.apache.hadoop.fs.LocalFileSystem.createNewFile()

      String accumuloPath = base + "/" + volume + "/accumulo";
      accumuloPaths.add(accumuloPath);

      if (uuids.get(i) != null) {
        fs.mkdirs(new Path(accumuloPath + "/" + ServerConstants.INSTANCE_ID_DIR));
        fs.createNewFile(new Path(accumuloPath + "/" + ServerConstants.INSTANCE_ID_DIR + "/" + uuids.get(i)));
      }

      if (dataVersions.get(i) != null) {
        fs.mkdirs(new Path(accumuloPath + "/" + ServerConstants.VERSION_DIR));
        fs.createNewFile(new Path(accumuloPath + "/" + ServerConstants.VERSION_DIR + "/" + dataVersions.get(i)));
View Full Code Here

Examples of org.apache.hadoop.hdfs.DistributedFileSystem.createNewFile()

      DistributedFileSystem hdfs = cluster.getFileSystem();
      String userDir = hdfs.getHomeDirectory().toUri().getPath().toString();
      Path file = new Path(userDir, "file");
      Path dir = new Path(userDir, "/dir");
      Path link = new Path(userDir, "/link");
      hdfs.createNewFile(file);
      hdfs.mkdirs(dir);
      hdfs.createSymlink(file, link, false);

      long mtimeFile = hdfs.getFileStatus(file).getModificationTime();
      long atimeFile = hdfs.getFileStatus(file).getAccessTime();
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.