Package org.apache.commons.vfs

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


            try
            {
                FileSystemManager mgr = VFS.getManager();
                System.out.println();
                System.out.println("Parsing: " + args[i]);
                FileObject file = mgr.resolveFile(args[i]);
                System.out.println("URL: " + file.getURL());
                System.out.println("getName(): " + file.getName());
                System.out.println("BaseName: " + file.getName().getBaseName());
                System.out.println("Extension: " + file.getName().getExtension());
                System.out.println("Path: " + file.getName().getPath());
View Full Code Here


      if ( fsManager == null ) {
        Logger.error( ApacheVFSOutputHandler.class.getName(), Messages.getInstance().getString(
          "ApacheVFSOutputHandler.ERROR_0001_CANNOT_GET_VFSMGR" ) ); //$NON-NLS-1$
        return null;
      }
      FileObject file = fsManager.resolveFile( contentName );
      if ( file == null ) {
        Logger.error( ApacheVFSOutputHandler.class.getName(), Messages.getInstance().getString(
            "ApacheVFSOutputHandler.ERROR_0002_CANNOT_GET_VF", contentName ) ); //$NON-NLS-1$
        return null;
      }
View Full Code Here

      public String locate( String catalogPath ) {
        if ( catalogPath.startsWith( "mondrian:" ) ) { //$NON-NLS-1$
          try {
            FileSystemManager fsManager = VFS.getManager();
            SolutionRepositoryVfsFileObject catalog = (SolutionRepositoryVfsFileObject)
                fsManager.resolveFile( catalogPath );
            catalogPath = "solution:" + catalog.getFileRef();
          } catch ( FileSystemException e ) {
            logger.error( e.getMessage() );
          }
        } else {
View Full Code Here

      FileSystemManager fsManager = VFS.getManager();


      SolutionRepositoryVfsFileObject mondrianDS =
        (SolutionRepositoryVfsFileObject) fsManager.resolveFile( urlStr );

      in = mondrianDS.getInputStream();
      res = schemaProcessor.filter( null, localeInfo, in );
    } catch ( FileNotFoundException fnfe ) {
      throw new MondrianCatalogServiceException( Messages.getInstance().getErrorString(
View Full Code Here

  protected String getSolutionRepositoryRelativePath( final String path, final IPentahoSession pentahoSession ) {

    try {
      FileSystemManager fsManager = VFS.getManager();
      return fsManager.resolveFile( path ).getName().getPath();
    } catch ( FileSystemException e ) {
      throw new MondrianCatalogServiceException( Messages.getInstance().getErrorString(
        "MondrianCatalogHelper.ERROR_0012_FILESYSTEM_PROBLEM" ), e ); //$NON-NLS-1$
    }
View Full Code Here

      if (!path.endsWith("" + File.separatorChar)) {
        path += File.separatorChar;
      }
      fileSystemManager = VFS.getManager();
      FileObject fileObject;
      fileObject = fileSystemManager.resolveFile(path);
      if (fileObject == null) {
        throw new IOException("File cannot be resolved: " + path);
      }
      if (!fileObject.exists()) {
        throw new IOException("File does not exist: " + path);
View Full Code Here

    FileSystemManager fileSystemManager;
    try {
      fileSystemManager = VFS.getManager();

      FileObject fileObject;
      fileObject = fileSystemManager.resolveFile(path);
      if (fileObject == null) {
        throw new IOException("File cannot be resolved: " + path);
      }
      if (!fileObject.exists()) {
        throw new IOException("File does not exist: " + path);
View Full Code Here

    FileSystemManager fileSystemManager;
    try {
      fileSystemManager = VFS.getManager();

      FileObject fileObject;
      fileObject = fileSystemManager.resolveFile(path);
      if (fileObject == null) {
        throw new IOException("File cannot be resolved: " + path);
      }
      if (!fileObject.exists()) {
        throw new IOException("File does not exist: " + path);
View Full Code Here

public class FilesetBookCreatorTest extends TestCase {

  public void test1() {
    try {
      FileSystemManager fsManager = VFS.getManager();
      FileObject dir = fsManager.resolveFile("ram://test-dir");
      dir.createFolder();
      FileObject chapter1 = dir.resolveFile("chapter1.html", NameScope.CHILD);
      chapter1.createFile();
      IOUtils.copy(this.getClass().getResourceAsStream("/book1/chapter1.html"), chapter1.getContent().getOutputStream());
      Book bookFromDirectory = FilesetBookCreator.createBookFromDirectory(dir, Constants.CHARACTER_ENCODING);
View Full Code Here

    }
  }

  private FileObject createDirWithSourceFiles() throws IOException {
    FileSystemManager fsManager = VFS.getManager();
    FileObject dir = fsManager.resolveFile("ram://fileset_test_dir");
    dir.createFolder();
    String[] sourceFiles = new String[] {
        "book1.css",
        "chapter1.html",
        "chapter2_1.html",
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.