Package org.apache.oodt.cas.pushpull.protocol

Examples of org.apache.oodt.cas.pushpull.protocol.RemoteSiteFile


      LOG.log(Level.INFO, "Testing protocol "
          + protocol.getClass().getCanonicalName()
          + " . . . this may take a few minutes . . .");
      // test ls, cd, and pwd
      this.cdToHOME(protocol);
      RemoteSiteFile home = this.pwd(remoteSite, protocol);
      this.ls(remoteSite, protocol);
      if (remoteSite.getCdTestDir() != null)
        this.cd(protocol, new RemoteSiteFile(home, remoteSite.getCdTestDir(),
            true, remoteSite));
      else
        this.cdToROOT(protocol);
      this.cdToHOME(protocol);
      if (home == null || !home.equals(this.pwd(remoteSite, protocol)))
        throw new ProtocolException("Home directory not the same after cd");
    } catch (Exception e) {
      LOG.log(Level.SEVERE, "Protocol "
          + protocol.getClass().getCanonicalName()
          + " failed compatibility test : " + e.getMessage(), e);
View Full Code Here


      this.putPgInfo(pgInfo = new PagingInfo(), pFile);
    return pgInfo;
  }

  public RemoteSiteFile pwd(RemoteSite site, Protocol protocol) throws ProtocolException {
    return new RemoteSiteFile(protocol.pwd(), site);
  }
View Full Code Here

  }

  public synchronized RemoteSiteFile getHomeDir(RemoteSite site, Protocol protocol) {
    try {
      protocol.cdHome();
      return new RemoteSiteFile(protocol.pwd(), site);
    } catch (Exception e) {
      e.printStackTrace();
      return null;
    }
  }
View Full Code Here

    try {
      if (!file.startsWith("/")) {
        protocol.cdHome();
        file = protocol.pwd().getPath() + "/" + file;
      }
      return new RemoteSiteFile(file, isDir, site);
    } catch (Exception e) {
      throw new ProtocolException("Failed to create protocol for " + file
          + " : " + e.getMessage());
    }
  }
View Full Code Here

  private List<RemoteSiteFile> toRemoteSiteFiles(List<ProtocolFile> files, RemoteSite site) {
    List<RemoteSiteFile> newFiles = new Vector<RemoteSiteFile>();
    if (files != null) {
      for (ProtocolFile file : files) {
        newFiles.add(new RemoteSiteFile(file, site));
      }
    }
    return newFiles;
  }
View Full Code Here

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

        // add starting directory to stack
        Stack<RemoteSiteFile> files = new Stack<RemoteSiteFile>();
        files.add(new RemoteSiteFile(frs.getCurrentFile(remoteSite), remoteSite));

        // start crawling
        while (!files.isEmpty()) {
            RemoteSiteFile file = files.peek();
            try {
                // if directory, then add its children to the crawl list
                if (file.isDir()) {

                    // get next page worth of children
                    List<RemoteSiteFile> children = frs.getNextPage(file,
                            new ProtocolFileFilter() {
                                @Override
View Full Code Here

            try {
                if (file.isDir())
                    protocolHandler.cd(session, file);
                else
                    protocolHandler.cd(session,
                          new RemoteSiteFile(file.getParent(), file.getSite()));
            } catch (Exception e) {
                e.printStackTrace();
                try {
                    protocolHandler.disconnect(session);
                } catch (Exception exc) {
View Full Code Here

      Protocol protocol = getAppropriateProtocol(pFile, allowReuse);
      if (protocol != null && navigateToPathLoc) {
        if (pFile.isDir())
          this.cd(protocol, pFile);
        else if (pFile.getParent() != null)
          this.cd(protocol, new RemoteSiteFile(pFile.getParent(), pFile.getSite()));
      }
      return protocol;
    } catch (Exception e) {
      throw new RemoteConnectionException(
          "Failed to get appropriate protocol for " + pFile + " : "
View Full Code Here

    try {
      if (!file.startsWith("/")) {
        protocol.cdHome();
        file = protocol.pwd().getPath() + "/" + file;
      }
      return new RemoteSiteFile(file, isDir, site);
    } catch (Exception e) {
      throw new ProtocolException("Failed to create protocol for " + file
          + " : " + e.getMessage());
    }
  }
View Full Code Here

  private List<RemoteSiteFile> toRemoteSiteFiles(List<ProtocolFile> files, RemoteSite site) {
    List<RemoteSiteFile> newFiles = new Vector<RemoteSiteFile>();
    if (files != null) {
      for (ProtocolFile file : files) {
        newFiles.add(new RemoteSiteFile(file, site));
      }
    }
    return newFiles;
  }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.pushpull.protocol.RemoteSiteFile

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.