Package org.apache.commons.vfs.impl

Examples of org.apache.commons.vfs.impl.DefaultFileSystemManager


    private String jarsDir = "target/nanodist/apps";
    private String folderPath = "src/deploytest";

    public void testZipWithDeploymentScriptAndClassesCanBeDeployed() throws FileSystemException, MalformedURLException, ClassNotFoundException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, InstantiationException {
        DefaultFileSystemManager manager = new DefaultFileSystemManager();
        FileObject applicationArchive = getApplicationArchive(manager, jarsDir + "/successful-deploy.jar");

        Deployer deployer = new NanoContainerDeployer(manager);
        ObjectReference containerRef = deployer.deploy(applicationArchive, getClass().getClassLoader(), null);
        PicoContainer pico = (PicoContainer) containerRef.get();
View Full Code Here


        assertEquals("Groovy Started", zap.toString());
    }

    public void testZipWithBadScriptNameThrowsFileSystemException() throws ClassNotFoundException, FileSystemException {

      DefaultFileSystemManager manager = new DefaultFileSystemManager();
      FileObject applicationFolder = getApplicationArchive(manager,  jarsDir + "/badscript-deploy.jar");

      try {
        Deployer deployer = new NanoContainerDeployer(manager);
        ObjectReference containerRef= deployer.deploy(applicationFolder, getClass().getClassLoader(), null);
View Full Code Here

        //a-ok
      }
    }

    public void testMalformedDeployerArchiveThrowsFileSystemException() throws ClassNotFoundException, FileSystemException {
      DefaultFileSystemManager manager = new DefaultFileSystemManager();
      FileObject applicationFolder = getApplicationArchive(manager,  jarsDir + "/malformed-deploy.jar");

      try {
        Deployer deployer = new NanoContainerDeployer(manager);
        ObjectReference containerRef= deployer.deploy(applicationFolder, getClass().getClassLoader(), null);
View Full Code Here

        //a-ok
      }
    }

    public void testFolderWithDeploymentScriptAndClassesCanBeDeployed() throws FileSystemException, MalformedURLException, ClassNotFoundException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, InstantiationException {
        DefaultFileSystemManager manager = new DefaultFileSystemManager();
        FileObject applicationFolder = getApplicationFolder(manager, folderPath);

        try {
            Deployer deployer = null;
            deployer = new NanoContainerDeployer(manager);
View Full Code Here

            e.printStackTrace()
        }
    }   

    public void testZapClassCanBeLoadedByVFSClassLoader() throws FileSystemException, MalformedURLException, ClassNotFoundException {
        DefaultFileSystemManager manager = new DefaultFileSystemManager();
        FileObject applicationFolder = getApplicationFolder(manager, folderPath);
        ClassLoader applicationClassLoader = new VFSClassLoader(applicationFolder, manager, getClass().getClassLoader());
        applicationClassLoader.loadClass("foo.bar.Zap");
    }
View Full Code Here

        ClassLoader applicationClassLoader = new VFSClassLoader(applicationFolder, manager, getClass().getClassLoader());
        applicationClassLoader.loadClass("foo.bar.Zap");
    }

    public void testSettingDifferentBaseNameWillResultInChangeForWhatBuilderLooksFor() throws FileSystemException, MalformedURLException, ClassNotFoundException {
        DefaultFileSystemManager manager = new DefaultFileSystemManager();
        FileObject applicationFolder = getApplicationFolder(manager, folderPath);
        NanoContainerDeployer deployer = new NanoContainerDeployer(manager);
        assertEquals("nanocontainer", deployer.getFileBasename());

        deployer = new NanoContainerDeployer(manager,"foo");
View Full Code Here

            boolean ftp, boolean sftp, boolean http, boolean gsiftp, boolean srb,
            boolean file, String tmpDirPath) throws FileSystemException {

        // note, fsManager is not a singleton here ! thus it is meant that
        // a fsManager is created per thread and close the fsManager
        DefaultFileSystemManager fsManager = new DefaultFileSystemManager();
        if (ftp) {
            fsManager.addProvider("ftp", new FtpFileProvider());
        }
        if (sftp) {
            fsManager.addProvider("sftp", new SftpFileProvider());
        }
        if (http) {
            fsManager.addProvider("http", new HttpFileProvider());
        }
        if (gsiftp) {
            fsManager.addProvider("gsiftp", new GridFtpFileProvider());
        }
        if (srb) {
            fsManager.addProvider("srb", new SrbFileProvider());
        }
        if (file) {
            fsManager.addProvider("file", new DefaultLocalFileProvider());
        }

        File xFile = null;
        if (tmpDirPath != null) {
            xFile = new File(tmpDirPath);
        } else {
            xFile = new File(System.getProperty("java.io.tmpdir", "/tmp"));
        }
        if (!xFile.exists()) {
            throw new IllegalStateException("cannot allocate temporary directory. Please set java.io.tmpdir system property");
        }
        fsManager.addProvider("tmp", new TemporaryFileProvider(xFile));
        fsManager.setTemporaryFileStore(new DefaultFileReplicator(xFile));
        fsManager.init();
        return fsManager;
    }
View Full Code Here

            boolean ftp, boolean sftp, boolean http, boolean gsiftp, boolean srb,
            boolean file, boolean irods, String tmpDirPath) throws FileSystemException {

        // note, fsManager is not a singleton here ! thus it is meant that
        // a fsManager is created per thread and close the fsManager
        DefaultFileSystemManager fsManager = new DefaultFileSystemManager();
        if (ftp) {
            fsManager.addProvider("ftp", new FtpFileProvider());
        }
        if (sftp) {
            fsManager.addProvider("sftp", new SftpFileProvider());
        }
        if (http) {
            fsManager.addProvider("http", new HttpFileProvider());
        }
        if (gsiftp) {
            fsManager.addProvider("gsiftp", new GridFtpFileProvider());
        }
        if (srb) {
            fsManager.addProvider("srb", new SRBFileProvider());
        }
        if (file) {
            fsManager.addProvider("file", new DefaultLocalFileProvider());
        }
        if(irods){
            fsManager.addProvider("irods", new IRODSFileProvider());
        }

        File xFile = null;
        if (tmpDirPath != null) {
            xFile = new File(tmpDirPath);
        } else {
            xFile = new File(System.getProperty("java.io.tmpdir", "/tmp"));
        }
        if (!xFile.exists()) {
            throw new IllegalStateException("cannot allocate temporary directory. Please set java.io.tmpdir system property");
        }
        fsManager.addProvider("tmp", new TemporaryFileProvider(xFile));
        fsManager.setTemporaryFileStore(new DefaultFileReplicator(xFile));
        fsManager.init();
        return fsManager;
    }
View Full Code Here

            boolean ftp, boolean sftp, boolean http, boolean gsiftp, boolean srb,
            boolean file, String tmpDirPath) throws FileSystemException {

        // note, fsManager is not a singleton here ! thus it is meant that
        // a fsManager is created per thread and close the fsManager
        DefaultFileSystemManager fsManager = new DefaultFileSystemManager();
        if (ftp) {
            fsManager.addProvider("ftp", new FtpFileProvider());
        }
        if (sftp) {
            fsManager.addProvider("sftp", new SftpFileProvider());
        }
        if (http) {
            fsManager.addProvider("http", new HttpFileProvider());
        }
        if (gsiftp) {
            fsManager.addProvider("gsiftp", new GridFtpFileProvider());
        }
        if (srb) {
            fsManager.addProvider("srb", new SRBFileProvider());
        }
        if (file) {
            fsManager.addProvider("file", new DefaultLocalFileProvider());
        }

        File xFile = null;
        if (tmpDirPath != null) {
            xFile = new File(tmpDirPath);
        } else {
            xFile = new File(System.getProperty("java.io.tmpdir", "/tmp"));
        }
        if (!xFile.exists()) {
            throw new IllegalStateException("cannot allocate temporary directory. Please set java.io.tmpdir system property");
        }
        fsManager.addProvider("tmp", new TemporaryFileProvider(xFile));
        fsManager.setTemporaryFileStore(new DefaultFileReplicator(xFile));
        fsManager.init();
        return fsManager;
    }
View Full Code Here

  public MondrianCatalogHelper() {
    super();

    try {
      DefaultFileSystemManager dfsm = (DefaultFileSystemManager) VFS.getManager();
      dfsm.addProvider( "mondrian", new MondrianVfs() ); //$NON-NLS-1$
    } catch ( FileSystemException e ) {
      logger.error( e.getMessage() );
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.vfs.impl.DefaultFileSystemManager

Copyright © 2018 www.massapicom. 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.