Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileObject.resolveFile()


        String uri = "tar:" + tarFilePath + "!/test.tar";
        final FileObject tarFile = manager.resolveFile(uri);

        // Now build the nested file system
        final FileObject nestedFS = manager.createFileSystem(tarFile);
        return nestedFS.resolveFile("/");
    }
}
View Full Code Here


   */
  public FileObject getFile() throws IOException {
    if (file == null) {
            FileObject root = getFileObject("");
            String stripLeadingSlash = DAVUtilities.stripLeadingSlash(getRelativePath());
      file = root.resolveFile(stripLeadingSlash, NameScope.DESCENDENT_OR_SELF);
      if (file == null) {
        throw new IOException("Could not create file object.");
      }
    }
    return file;
View Full Code Here

        String uri = "zip:" + zipFilePath + "!/test.zip";
        final FileObject zipFile = manager.resolveFile(uri);

        // Now build the nested file system
        final FileObject nestedFS = manager.createFileSystem(zipFile);
        return nestedFS.resolveFile("/");
    }
}
View Full Code Here

        {
            assertSameMessage("vfs.provider/list-children-not-folder.error", file, e);
        }

        // Should be able to get child by name
        file = file.resolveFile("some-child");
        assertNotNull(file);

        // Check for unknown file
        file = getReadFolder().resolveFile("unknown-file");
        assertTrue(!file.exists());
View Full Code Here

        String uri = "tgz:" + tarFilePath + "!/test.tgz";
        final FileObject tarFile = manager.resolveFile(uri);

        // Now build the nested file system
        final FileObject nestedFS = manager.createFileSystem(tarFile);
        return nestedFS.resolveFile("/");
    }
}
View Full Code Here

        String uri = "tbz2:" + tarFilePath + "!/test.tbz2";
        final FileObject tarFile = manager.resolveFile(uri);

        // Now build the nested file system
        final FileObject nestedFS = manager.createFileSystem(tarFile);
        return nestedFS.resolveFile("/");
    }
}
View Full Code Here

        String uri = "tar:" + tarFilePath + "!/test.tar";
        final FileObject tarFile = manager.resolveFile(uri);

        // Now build the nested file system
        final FileObject nestedFS = manager.createFileSystem(tarFile);
        return nestedFS.resolveFile("/");
    }
}
View Full Code Here

    if (realBaseFile == null)
    {
      throw new FileSystemException("vfs.impl/find-rel-file.error", uri);
    }

    return realBaseFile.resolveFile(uri);
  }

  /**
   * Resolves a name, relative to the file. If the supplied name is an
   * absolute path, then it is resolved relative to the root of the file
View Full Code Here

     */
    public void testDelete() throws Exception
    {
        // Set-up the test structure
        FileObject folder = createScratchFolder();
        folder.resolveFile("file1.txt").createFile();
        folder.resolveFile("file%25.txt").createFile();
        folder.resolveFile("emptydir").createFolder();
        folder.resolveFile("dir1/file1.txt").createFile();
        folder.resolveFile("dir1/dir2/file2.txt").createFile();

View Full Code Here

    public void testDelete() throws Exception
    {
        // Set-up the test structure
        FileObject folder = createScratchFolder();
        folder.resolveFile("file1.txt").createFile();
        folder.resolveFile("file%25.txt").createFile();
        folder.resolveFile("emptydir").createFolder();
        folder.resolveFile("dir1/file1.txt").createFile();
        folder.resolveFile("dir1/dir2/file2.txt").createFile();

        // Delete a file
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.