Package java.nio.file

Examples of java.nio.file.Path.toFile()


public class FileTests {

  @Test
  public void path() {
    Path path = FileSystems.getDefault().getPath("./src/main/resources/socket.io.js");
    System.out.println(path.toFile().isFile());
    System.out.println(path.toString());
  }
}
View Full Code Here


        @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {

            Path dir_created = target.resolve(source.relativize(dir));
            try {
                log("\tDIR: " + dir_created);
                dir_created.toFile().mkdirs();
                return FileVisitResult.CONTINUE;
            } catch (Exception exc) {
                UtilityFX.warning("Exception EXC:" + exc.toString());
                exc.printStackTrace();
                exception = new BaseApplicationException(exc.toString()).setException(exc);
View Full Code Here

        @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {

            Path dir_created = target.resolve(source.relativize(dir));
            try {
                log("\tDIR: " + dir_created);
                dir_created.toFile().mkdirs();
                return FileVisitResult.CONTINUE;
            } catch (Exception exc) {
                UtilityFX.warning("Exception EXC:" + exc.toString());
                exc.printStackTrace();
                exception = new BaseApplicationException(exc.toString()).setException(exc);
View Full Code Here

            File tempFile = null;
            String tempFileName = String.format("document%d", counter.incrementAndGet());
            String tempFileExt = ".tmp";
            if (StringUtils.isNotBlank(officeIntegration.getTemporaryDirPath())) {
                Path tempDir = Paths.get(officeIntegration.getTemporaryDirPath());
                tempDir.toFile().mkdirs();

                tempFile = Files.createTempFile(
                        tempDir,
                        tempFileName,
                        tempFileExt)
View Full Code Here

          IOUtil.class.getName(),
          IOUtil.tempFileCounter++,
          System.currentTimeMillis())
          , "tmp");
           
      tempPath.toFile().deleteOnExit();
     
      return tempPath;
    } catch (Exception ex) {
      throw new JuException("Couldn't create temporary file", ex);
    }
View Full Code Here

          IOUtil.class.getName(),
          IOUtil.tempFileCounter++,
          System.currentTimeMillis())
          , "tmp");
           
      tempPath.toFile().deleteOnExit();
     
      return tempPath;
    } catch (Exception ex) {
      throw new JuException("Couldn't create temporary file", ex);
    }
View Full Code Here

        File tempFile;
        try {
            Path tempPath = Files.createTempFile(runtimeName, null);
            Files.copy(inputStream, tempPath, REPLACE_EXISTING);
            contentURL = tempPath.toUri().toURL();
            tempFile = tempPath.toFile();
        } catch (Exception ex) {
            throw new ProvisionException(ex);
        }

        ResourceBuilder builder;
View Full Code Here

        @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {

            Path dir_created = target.resolve(source.relativize(dir));
            try {
                log("\tDIR: " + dir_created);
                dir_created.toFile().mkdirs();
                return FileVisitResult.CONTINUE;
            } catch (Exception exc) {
                Utility.warning("Exception EXC:" + exc.toString());
                exc.printStackTrace();
                exception = new BaseApplicationException(exc.toString()).setException(exc);
View Full Code Here

  public void setUp() throws Exception {
    Path root = util.createTempDir().toPath();
    Path content = root.resolve("content");
    Path metadata = root.resolve("metadata");

    this.metadataStore = MapdbBlobMetadataStore.create(metadata.toFile());
    this.underTest = new FileBlobStore(content, new VolumeChapterLocationStrategy(), new SimpleFileOperations(), metadataStore);
    underTest.start();
  }

  @After
View Full Code Here

    final Path root = appDirs.getWorkDirectory(NAME).toPath();

    Path content = root.resolve("content");
    Path metadata = root.resolve("metadata");

    this.metadataStore = MapdbBlobMetadataStore.create(metadata.toFile());

    return new FileBlobStore(content, new VolumeChapterLocationStrategy(), new SimpleFileOperations(), metadataStore);
  }
}
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.