Examples of ProtocolFile


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

            boolean isDir) throws ProtocolException {
        try {
            if (!file.startsWith("/"))
                file = this.homeDir.getProtocolPath().getPathString() + "/"
                        + file;
            return new ProtocolFile(this.getRemoteSite(), new ProtocolPath(
                    file, isDir));
        } catch (Exception e) {
            throw new ProtocolException("Failed to create protocol for " + file
                    + " : " + e.getMessage());
        }
View Full Code Here

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

      openFolder(currentFolder);
      if (!currentFolder.getFullName().equals(
          store.getDefaultFolder().getFullName())) {
        Message[] messages = currentFolder.getMessages();
        for (Message message : messages) {
          currentFilesForCurrentFolder.add(new ProtocolFile(this
              .getRemoteSite(), new ProtocolPath(this.pwd().getProtocolPath()
              .getPathString()
              + "/" + this.getMessageName(message), false)));
        }
      }
View Full Code Here

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

      throws ProtocolException {
    try {
      String pwd = this.currentFolder.getFullName();
      if (!pwd.equals("") && !pwd.startsWith("/"))
        pwd = "/" + pwd;
      return new ProtocolFile(this.getRemoteSite(), new ProtocolPath(pwd, true));
    } catch (Exception e) {
      throw new ProtocolException("Failed to pwd : " + e.getMessage());
    }
  }
View Full Code Here

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

        Stack<ProtocolFile> files = new Stack<ProtocolFile>();
        files.add(frs.getCurrentFile(remoteSite));

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

                    // get next page worth of children
                    List<ProtocolFile> children = frs.getNextPage(file,
                            new ProtocolFileFilter() {
                                public boolean accept(ProtocolFile pFile) {
View Full Code Here

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

        try {
            LinkedList<ProtocolFile> files = new LinkedList<ProtocolFile>();
            File[] fileList = currentFile.listFiles();
            for (File file : fileList) {
                if (file != null)
                    files.add(new ProtocolFile(this.getRemoteSite(),
                            new ProtocolPath(file.getAbsolutePath(), file
                                    .isDirectory())));
            }
            return files;
        } catch (Exception e) {
View Full Code Here

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

    }

    @Override
    public ProtocolFile getCurrentWorkingDir() throws ProtocolException {
        try {
            return new ProtocolFile(this.getRemoteSite(), new ProtocolPath(
                    currentFile.getAbsolutePath(), true));
        } catch (Exception e) {
            throw new ProtocolException("Failed to pwd : " + e.getMessage());
        }
    }
View Full Code Here

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

    return parseLink(currentPath);
  }

  public ProtocolFile getCurrentWorkingDir() throws ProtocolException {
    try {
      return new ProtocolFile(this.getRemoteSite(), currentPath);
    } catch (Exception e) {
      throw new ProtocolException("Failed to get current working directory : "
          + e.getMessage());
    }
  }
View Full Code Here

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

          String href = link.getUri();
          String linkName = link.getTitle();
          String curPath = this.pwd().getProtocolPath().getPathString();
          String linkPath = curPath + (curPath.endsWith("/") ? "" : "/")
              + linkName;
          children.add(new ProtocolFile(this.getRemoteSite(), new HttpPath(
              linkPath, isDirectory(href, linkPath), new URL(href), path)));
        }
        linkChildren.put(path.getLink().toString(), children);

      } catch (Exception e) {
View Full Code Here

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

              continue;
            }
          }
        } while (st.hasMoreTokens());
        if (curPath.equals(this.parentPath))
          return new ProtocolFile(this.getRemoteSite(), new HttpPath(path,
              isDir, new URL("http://"
                  + this.getRemoteSite().getURL().getHost() + path), curPath));
      }
      return new ProtocolFile(this.getRemoteSite(), curPath);
    } catch (Exception e) {
      throw new ProtocolException("Failed to get ProtocolPath for " + path);
    }
  }
View Full Code Here

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

    if (urlString == null)
      throw new Exception("Must specify a url to download: --url <url>");

    URL url = new URL(urlString);
    ProtocolFile urlFile = new ProtocolFile(null, new HttpPath(url.getPath(),
        false, url, null));
    File toFile = new File(downloadToDir, urlFile.getName());
    toFile = toFile.getAbsoluteFile();
    toFile.createNewFile();
    new HttpClient().getFile(urlFile, toFile);
  }
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.