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

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


 
  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

        sftpChannel.rmdir(file.getPath());
      } else {
        sftpChannel.rm(file.getPath());
      }
    } catch (Exception e) {
      throw new ProtocolException("Failed to download file '" + file + "' : " + e.getMessage(), e);
    }
  }
View Full Code Here

            LOG.log(Level.WARNING, "Failed to instanciate protocol " + clazz
                + " for " + remoteSite.getURL());
          }
        }
        if (protocol == null)
          throw new ProtocolException("Failed to get appropriate protocol for "
              + remoteSite);
      } else {
        connect(protocol = protocolFactory.newInstance(), remoteSite, false);
      }
      if (allowReuse)
View Full Code Here

            true, remoteSite));
      else
        this.cdToROOT(protocol);
      this.cdToHOME(protocol);
      if (home == null || !home.equals(protocol.pwd()))
        throw new ProtocolException("Home directory not the same after cd");
    } catch (Exception e) {
      LOG.log(Level.SEVERE, "Protocol "
          + protocol.getClass().getCanonicalName()
          + " failed compatibility test : " + e.getMessage());
      return false;
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.