Examples of pathToFile()


Examples of ca.simplegames.micro.repositories.Repository.pathToFile()

        if (configuration != null && configuration.get(Globals.REPOSITORY) != null) {
            defaultRepository = site.getRepositoryManager()
                    .getRepository((String) configuration.get(Globals.REPOSITORY));
        }

        File file = defaultRepository.pathToFile(
                String.format(FILE_FORMAT, params.get(IMAGE_FILE), params.get(TYPE)));

        String fileType = PathUtilities.extractType(file.getAbsolutePath());

        if (file.exists()) {
View Full Code Here

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

    FileStatus stat = make(stub(FileStatus.class)
        .returning(normalPerm, normalPerm, badPerm).from.getPermission());
    when(stat.isDirectory()).thenReturn(true);
    LocalFileSystem fs = make(stub(LocalFileSystem.class)
        .returning(stat).from.getFileStatus(any(Path.class)));
    when(fs.pathToFile(any(Path.class))).thenReturn(localDir);
    Collection<URI> uris = Arrays.asList(new URI("file:/p1/"),
        new URI("file:/p2/"), new URI("file:/p3/"));

    List<File> dirs = DataNode.getDataDirsFromURIs(uris, fs, normalPerm);
View Full Code Here

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

    FileStatus stat = make(stub(FileStatus.class)
        .returning(normalPerm, normalPerm, badPerm).from.getPermission());
    when(stat.isDirectory()).thenReturn(true);
    LocalFileSystem fs = make(stub(LocalFileSystem.class)
        .returning(stat).from.getFileStatus(any(Path.class)));
    when(fs.pathToFile(any(Path.class))).thenReturn(localDir);
    Collection<URI> uris = Arrays.asList(new URI("file:/p1/"),
        new URI("file:/p2/"), new URI("file:/p3/"));

    List<File> dirs = DataNode.getDataDirsFromURIs(uris, fs, normalPerm);
View Full Code Here

Examples of org.apache.hadoop.fs.RawLocalFileSystem.pathToFile()

     * if it doesn't exist.
     */
    private void sameVolRename(Path srcPath,
        Path dstPath) throws IOException {
      RawLocalFileSystem rfs = (RawLocalFileSystem)this.rfs;
      File src = rfs.pathToFile(srcPath);
      File dst = rfs.pathToFile(dstPath);
      if (!dst.getParentFile().exists()) {
        if (!dst.getParentFile().mkdirs()) {
          throw new IOException("Unable to rename " + src + " to "
              + dst + ": couldn't create parent directory");
View Full Code Here

Examples of org.apache.hadoop.fs.RawLocalFileSystem.pathToFile()

     */
    private void sameVolRename(Path srcPath,
        Path dstPath) throws IOException {
      RawLocalFileSystem rfs = (RawLocalFileSystem)this.rfs;
      File src = rfs.pathToFile(srcPath);
      File dst = rfs.pathToFile(dstPath);
      if (!dst.getParentFile().exists()) {
        if (!dst.getParentFile().mkdirs()) {
          throw new IOException("Unable to rename " + src + " to "
              + dst + ": couldn't create parent directory");
        }
View Full Code Here

Examples of org.apache.hadoop.fs.RawLocalFileSystem.pathToFile()

    Assert.assertNotNull(url);
    File data = new File(url.toURI());
    Path tmpFile = new Path(data.getAbsolutePath());
   
    // Setup the Mapper
    WikipediaInputSplit split = new WikipediaInputSplit(new FileSplit(tmpFile, 0, fs.pathToFile(tmpFile).length(), null),0);
    AggregatingRecordReader rr = new AggregatingRecordReader();
    Path ocPath = new Path(tmpFile, "oc");
    OutputCommitter oc = new FileOutputCommitter(ocPath, context);
    fs.deleteOnExit(ocPath);
    StandaloneStatusReporter sr = new StandaloneStatusReporter();
View Full Code Here

Examples of org.apache.hadoop.fs.RawLocalFileSystem.pathToFile()

    Assert.assertNotNull(url);
    File data = new File(url.toURI());
    Path tmpFile = new Path(data.getAbsolutePath());
   
    // Setup the Mapper
    InputSplit split = new FileSplit(tmpFile, 0, fs.pathToFile(tmpFile).length(), null);
    AggregatingRecordReader rr = new AggregatingRecordReader();
    Path ocPath = new Path(tmpFile, "oc");
    OutputCommitter oc = new FileOutputCommitter(ocPath, context);
    fs.deleteOnExit(ocPath);
    StandaloneStatusReporter sr = new StandaloneStatusReporter();
View Full Code Here

Examples of org.apache.hadoop.fs.RawLocalFileSystem.pathToFile()

     * if it doesn't exist.
     */
    private void sameVolRename(Path srcPath,
        Path dstPath) throws IOException {
      RawLocalFileSystem rfs = (RawLocalFileSystem)this.rfs;
      File src = rfs.pathToFile(srcPath);
      File dst = rfs.pathToFile(dstPath);
      if (!dst.getParentFile().exists()) {
        if (!dst.getParentFile().mkdirs()) {
          throw new IOException("Unable to rename " + src + " to "
              + dst + ": couldn't create parent directory");
View Full Code Here

Examples of org.apache.hadoop.fs.RawLocalFileSystem.pathToFile()

     */
    private void sameVolRename(Path srcPath,
        Path dstPath) throws IOException {
      RawLocalFileSystem rfs = (RawLocalFileSystem)this.rfs;
      File src = rfs.pathToFile(srcPath);
      File dst = rfs.pathToFile(dstPath);
      if (!dst.getParentFile().exists()) {
        if (!dst.getParentFile().mkdirs()) {
          throw new IOException("Unable to rename " + src + " to "
              + dst + ": couldn't create parent directory");
        }
View Full Code Here

Examples of org.apache.hadoop.fs.RawLocalFileSystem.pathToFile()

   * RawLocalFileSystem's rename method, except that it will not fall back to a
   * copy, and it will create the target directory if it doesn't exist.
   */
  protected void sameVolRename(Path srcPath, Path dstPath) throws IOException {
    RawLocalFileSystem rfs = (RawLocalFileSystem) this.rfs;
    File src = rfs.pathToFile(srcPath);
    File dst = rfs.pathToFile(dstPath);
    if (!dst.getParentFile().exists()) {
      if (!dst.getParentFile().mkdirs()) {
        throw new IOException("Unable to rename " + src + " to " + dst
            + ": couldn't create parent directory");
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.