Package org.apache.oodt.cas.protocol

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


      for (int i = 0; i < files.length; i++) {
        FTPFile file = files[i];
        if (file == null)
          continue;
        String path = this.pwd().getPath();
        ProtocolFile pFile = new ProtocolFile(path + "/" + file.getName(), file
            .isDirectory());
        if (filter.accept(pFile)) {
          returnFiles.add(pFile);
        }
      }
View Full Code Here


          + e.getMessage());
    }
  }

  public void cdRoot() throws ProtocolException {
    cd(new ProtocolFile(ProtocolFile.SEPARATOR, true));
  }
View Full Code Here

  public void cdRoot() throws ProtocolException {
    cd(new ProtocolFile(ProtocolFile.SEPARATOR, true));
  }

  public void cdHome() throws ProtocolException {
    cd(new ProtocolFile(homeDir, true));
  }
View Full Code Here

  }
 
  public void testLSandCDandPWD() throws ProtocolException {
    CogJGlobusFtpProtocol ftpProtocol = new CogJGlobusFtpProtocol(PORT);
    ftpProtocol.connect("localhost", new BasicAuthentication("anonymous", "password"));
    ftpProtocol.cd(new ProtocolFile("testdata", true));
    List<ProtocolFile> lsResults = ftpProtocol.ls();
    assertTrue(lsResults.contains(new ProtocolFile(ftpProtocol.pwd(), "users.properties", false)));
  }
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

    }
  }

  public synchronized void cdRoot() throws ProtocolException {
    try {
      cd(new ProtocolFile("/", true));
    } catch (Exception e) {
      throw new ProtocolException("Failed to cd to root : " + e.getMessage(), e);
    }
  }
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.pwd().getPath()
              + "/" + this.getMessageName(message), false));
        }
      }
      // changedDir = false;
    } catch (Exception 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

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.