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

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


          ftp.setActive(ftp.setLocalPassive());
          Vector<FileInfo> fileList = (Vector<FileInfo>) ftp.list("*", null);
          Vector<ProtocolFile> returnList = new Vector<ProtocolFile>();
          String path = this.pwd().getProtocolPath().getPathString();
          for (FileInfo file : fileList) {
              returnList.add(new ProtocolFile(this.getRemoteSite(),
                      new ProtocolPath(path + "/" + file.getName(), file
                              .isDirectory())));
          }
          return returnList;
      } catch (Exception e) {
View Full Code Here


      }
  }

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

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

            for (int i = 0; i < files.length; i++) {
                FTPFile file = files[i];
                if (file == null)
                    continue;
                String path = this.pwd().getURL().getPath();
                returnFiles.add(new ProtocolFile(this.getRemoteSite(),
                        new ProtocolPath(path + "/" + file.getName(), file
                                .isDirectory())));
            }
            // System.out.println("RETURN FILES: " + returnFiles);
            return returnFiles;
View Full Code Here

     */
    public synchronized void cd(ProtocolFile file) throws ProtocolException {
        if (!this.cwd.equals(file)) {
            LOG.log(Level.INFO, "Changing to directory '" + file + "'");
            if (file.isRelativeToHOME())
                file = new ProtocolFile(file.getRemoteSite(), new ProtocolPath(
                        this.homeDir.getProtocolPath().getPathString() + "/"
                                + file.getProtocolPath().getPathString(), file
                                .isDirectory()));
            chDir(file.getProtocolPath());
            this.cwd = file;
View Full Code Here

    public synchronized void cdToROOT() throws ProtocolException {
        try {
            LOG.log(Level.INFO, "Changing to ROOT directory '/'");
            this.cdToRoot();
            this.cwd = new ProtocolFile(this.getRemoteSite(), new ProtocolPath(
                    "/", true));
        } catch (Exception e) {
            throw new ProtocolException("Failed to cd to Root directory : "
                    + e.getMessage());
        }
View Full Code Here

      Vector<ChannelSftp.LsEntry> sftpFiles = (Vector<ChannelSftp.LsEntry>) sftpChannel
          .ls(sftpChannel.pwd());
      Vector<ProtocolFile> returnFiles = new Vector<ProtocolFile>();
      for (ChannelSftp.LsEntry sftpFile : sftpFiles) {
        String path = this.pwd().getProtocolPath().getPathString();
        returnFiles.add(new ProtocolFile(this.getRemoteSite(),
            new ProtocolPath(path + "/" + sftpFile.getFilename(), sftpFile
                .getAttrs().isDir())));
      }
      return returnFiles;
    } catch (Exception e) {
View Full Code Here

    }
  }

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

            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

      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

TOP

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

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.