Package org.apache.oodt.cas.pushpull.filerestrictions

Examples of org.apache.oodt.cas.pushpull.filerestrictions.VirtualFileStructure


            File propFile, DataFilesInfo dfi, DataFileToPropFileLinker linker)
            throws Exception {
        RemoteSite remoteSite = null;

        // parse property file
        VirtualFileStructure vfs = propFileParser.parse(new FileInputStream(
                propFile));
        DownloadInfo di = dfi.getDownloadInfo();
        if (!di.isAllowAliasOverride()
                || (remoteSite = vfs.getRemoteSite()) == null)
            remoteSite = di.getRemoteSite();
        LinkedList<String> fileList = FileRestrictions.toStringList(vfs
                .getRootVirtualFile());

        // download data files specified in property file
        for (String file : fileList) {
            try {
View Full Code Here


            File propFile, DataFilesInfo dfi, DataFileToPropFileLinker linker)
            throws Exception {
        RemoteSite remoteSite;

        // parse property file
        VirtualFileStructure vfs = propFileParser.parse(new FileInputStream(
                propFile));

        // determine RemoteSite
        DownloadInfo di = dfi.getDownloadInfo();
        if (!di.isAllowAliasOverride()
                || (remoteSite = vfs.getRemoteSite()) == null)
            remoteSite = di.getRemoteSite();

        // modify vfs to be root based if HOME directory based
        if (!vfs.isRootBased()) {
            String homeDirPath = frs.getHomeDir(remoteSite).getProtocolPath()
                    .getPathString();
            VirtualFile root = new VirtualFile(homeDirPath, true);
            root.addChild(vfs.getRootVirtualFile());
            vfs = new VirtualFileStructure(homeDirPath + "/"
                    + vfs.getPathToRoot(), root.getRootDir());
            frs.changeToHOME(remoteSite);
        }

        // initialize variables
        final String initialCdPath = vfs.getPathToRoot();
        final VirtualFile vf = vfs.getRootVirtualFile();

        // change to initial directory (takes care of Linux auto-mounting)
        frs.changeToDir(initialCdPath, remoteSite);

        // add starting directory to stack
View Full Code Here

                    parseVariablesXML(node.getChildNodes());
                } else if (node.getNodeName().equals("methods")) {
                    parseMethodsXML(node.getChildNodes());
                }
            }
            return new VirtualFileStructure(initialCdDir, root);
        } catch (Exception e) {
            e.printStackTrace();
            throw new ParserException("Failed to parse XML file : "
                    + e.getMessage());
        }
View Full Code Here

            while (scanner.hasNextLine()) {
                new VirtualFile(root, initialCdDir + "/" + scanner.nextLine(),
                        false);
            }
        }
        return new VirtualFileStructure(initialCdDir, root);
    }
View Full Code Here

                        + ftpSite), "anonymous", System
                        .getenv("user.name")
                        + "@jpl.nasa.gov");
            }

            return new VirtualFileStructure(remoteSite, "/", root);
        } catch (Exception e) {
            e.printStackTrace();
            throw new ParserException("Failed to parse IASI email : "
                    + e.getMessage());
        }
View Full Code Here

    for (String filePath : filePaths) {
      new VirtualFile(root, pathToRoot + filePath, false);
    }

    return new VirtualFileStructure("/", root);
  }
View Full Code Here

            File propFile, DataFilesInfo dfi, DataFileToPropFileLinker linker)
            throws Exception {
        RemoteSite remoteSite;

        // parse property file
        VirtualFileStructure vfs = propFileParser.parse(new FileInputStream(
                propFile));

        // determine RemoteSite
        DownloadInfo di = dfi.getDownloadInfo();
        if (!di.isAllowAliasOverride()
                || (remoteSite = vfs.getRemoteSite()) == null)
            remoteSite = di.getRemoteSite();

        // modify vfs to be root based if HOME directory based
        if (!vfs.isRootBased()) {
            String homeDirPath = frs.getHomeDir(remoteSite).getPath();
            VirtualFile root = new VirtualFile(homeDirPath, true);
            root.addChild(vfs.getRootVirtualFile());
            vfs = new VirtualFileStructure(homeDirPath + "/"
                    + vfs.getPathToRoot(), root.getRootDir());
            frs.changeToHOME(remoteSite);
        }

        // initialize variables
        final String initialCdPath = vfs.getPathToRoot();
        final VirtualFile vf = vfs.getRootVirtualFile();

        // change to initial directory (takes care of Linux auto-mounting)
        frs.changeToDir(initialCdPath, remoteSite);

        // add starting directory to stack
View Full Code Here

  @Test
  public void testGenericEmailParser() throws ParserException, FileNotFoundException {
    GenericEmailParser parser = new GenericEmailParser(
        "Wav File: ([^\\s]+)", "Dear Lousy Customer,", null);
    VirtualFileStructure vfs = parser.parse(new FileInputStream(emailFile));
    List<String> filePaths = FileRestrictions.toStringList(vfs.getRootVirtualFile());
    assertThat(filePaths.size(), Matchers.is(1));
    assertThat(filePaths.get(0), Matchers.is("/some/path/to/a/wav/file.wav"));
  }
View Full Code Here

                    parseVariablesXML(node.getChildNodes());
                } else if (node.getNodeName().equals("methods")) {
                    parseMethodsXML(node.getChildNodes());
                }
            }
            return new VirtualFileStructure(initialCdDir, root);
        } catch (Exception e) {
            e.printStackTrace();
            throw new ParserException("Failed to parse XML file : "
                    + e.getMessage());
        }
View Full Code Here

            File propFile, DataFilesInfo dfi, DataFileToPropFileLinker linker)
            throws Exception {
        RemoteSite remoteSite;

        // parse property file
        VirtualFileStructure vfs = propFileParser.parse(new FileInputStream(
                propFile));

        // determine RemoteSite
        DownloadInfo di = dfi.getDownloadInfo();
        if (!di.isAllowAliasOverride()
                || (remoteSite = vfs.getRemoteSite()) == null)
            remoteSite = di.getRemoteSite();

        // modify vfs to be root based if HOME directory based
        if (!vfs.isRootBased()) {
            String homeDirPath = frs.getHomeDir(remoteSite).getPath();
            VirtualFile root = new VirtualFile(homeDirPath, true);
            root.addChild(vfs.getRootVirtualFile());
            vfs = new VirtualFileStructure(homeDirPath + "/"
                    + vfs.getPathToRoot(), root.getRootDir());
            frs.changeToHOME(remoteSite);
        }

        // initialize variables
        final String initialCdPath = vfs.getPathToRoot();
        final VirtualFile vf = vfs.getRootVirtualFile();

        // change to initial directory (takes care of Linux auto-mounting)
        frs.changeToDir(initialCdPath, remoteSite);

        // add starting directory to stack
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.pushpull.filerestrictions.VirtualFileStructure

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.