Package org.apache.oodt.cas.protocol.exceptions

Examples of org.apache.oodt.cas.protocol.exceptions.ProtocolException


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


 
  public void cd(ProtocolFile file) throws ProtocolException {
    try {
      sftpChannel.cd(file.getPath());
    } catch (Exception e) {
      throw new ProtocolException("Failed to cd to " + file + " : "
          + e.getMessage());
    }
  }
View Full Code Here

      session.connect();
      sftpChannel = (ChannelSftp) session.openChannel("sftp");
      sftpChannel.connect();
      homeDir = pwd();
    } catch (Exception e) {
      throw new ProtocolException("Failed to connect to host " + host + " : "
          + e.getMessage(), e);
    }
  }
View Full Code Here

      throws ProtocolException {
    try {
      sftpChannel.get(fromFile.getPath(), toFile
          .getAbsolutePath());
    } catch (Exception e) {
      throw new ProtocolException("Failed to download " + fromFile + " : "
          + e.getMessage());
    }
  }
View Full Code Here

 
  public void put(File fromFile, ProtocolFile toFile) throws ProtocolException {
    try {
      sftpChannel.put(fromFile.getAbsolutePath(), toFile.getPath());
    } catch (Exception e) {
      throw new ProtocolException("Failed to put file '" + fromFile + "' : " + e.getMessage(), e);
    }
  }
View Full Code Here

        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

          returnFiles.add(pFile);
        }
      }
      return returnFiles;
    } catch (Exception e) {
      throw new ProtocolException("Failed to get file list : " + e.getMessage());
    }
  }
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 void delete(ProtocolFile file) throws ProtocolException {
    try {
      sftpChannel.rm(file.getPath());
    } catch (Exception e) {
      throw new ProtocolException("Failed to download file '" + file + "' : " + e.getMessage(), e);
    }
  }
View Full Code Here

            MalformedURLException, org.apache.oodt.cas.protocol.exceptions.ProtocolException {
        if (validate(remoteSite))
            protocolHandler.cdToROOT(protocolHandler
                    .getAppropriateProtocolBySite(remoteSite, true));
        else
            throw new ProtocolException("Not a valid remote site " + remoteSite);
    }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.protocol.exceptions.ProtocolException

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.