Package org.apache.oodt.cas.protocol

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


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


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

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

          + e.getMessage());
    }
  }
 
  public void cdRoot() throws ProtocolException {
    cd(new ProtocolFile(ProtocolFile.SEPARATOR, true));
  }
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().getPath();
        returnFiles.add(new ProtocolFile(path + "/" + sftpFile.getFilename(), sftpFile
                .getAttrs().isDir()));
      }
      return returnFiles;
    } catch (Exception e) {
      throw new ProtocolException("Failed to get file list : " + 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().getPath();
        ProtocolFile pFile = new ProtocolFile(path + "/" + sftpFile.getFilename(), sftpFile
            .getAttrs().isDir());
        if (filter.accept(pFile)) {
          returnFiles.add(pFile);
        }
      }
View Full Code Here

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

    }
  }

  public String getAbsPathFor(Protocol protocol, String path, boolean isDir) {
    try {
      protocol.cd(new ProtocolFile(path, isDir));
      return protocol.pwd().getAbsoluteFile().getPath();
    } catch (Exception e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public ProtocolFile pwd() throws ProtocolException {
    try {
      return new ProtocolFile(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().getPath();
        returnFiles.add(new ProtocolFile(path + "/" + file.getName(), file
            .isDirectory()));
      }
      return returnFiles;
    } catch (Exception e) {
      throw new ProtocolException("Failed to get file list : " + e.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.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.