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

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


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


  public void cd(ProtocolFile file) throws ProtocolException {
    try {
      if (!ftp.changeWorkingDirectory(file.getPath()))
        throw new Exception("Directory change method returned false");
    } catch (Exception e) {
      throw new ProtocolException("Failed to cd to " + file.getPath() + " : "
          + e.getMessage());
    }
  }
View Full Code Here

   */
  public void close() throws ProtocolException {
    try {
      ftp.disconnect();
    } catch (Exception e) {
      throw new ProtocolException("Failed to disconnect from server");
    }
  }
View Full Code Here

   */
  public void delete(ProtocolFile file) throws ProtocolException {
    try {
      ftp.deleteFile(file.getPath());
    } catch (Exception e) {
      throw new ProtocolException("Failed to delete file '" + file.getPath()
          + "' : " + e.getMessage(), e);
    }
  }
View Full Code Here

        httpFile = (HttpFile) file;
      }
     
      if (!HttpUtils
          .isDirectory(httpFile.getLink(), file.getPath()))
        throw new ProtocolException(file
            + " is not a directory (mime type must be text/html)");
      this.currentFile = httpFile;
    } catch (Exception e) {
      throw new ProtocolException("Failed to cd to " + file + " : "
          + e.getMessage(), e);
    }
  }
View Full Code Here

      URL url = new URL("http://" + host + "/");
      url.openStream().close();
      currentFile = parentFile = new HttpFile("/", true, url);
      isConnected = true;
    } catch (Exception e) {
      throw new ProtocolException("Failed to connect to http://" + host + " : "
          + e.getMessage());
    }
  }
View Full Code Here

        numWritten += numRead;
      }
      in.close();
      out.close();
    } catch (Exception e) {
      throw new ProtocolException("Failed to get file '" + fromFile + "' : "
          + e.getMessage(), e);
    } finally {
      if (in != null)
        try {
          in.close();
View Full Code Here

 
  public ProtocolFile pwd() throws ProtocolException {
    try {
      return currentFile;
    } catch (Exception e) {
      throw new ProtocolException("Failed to get current working directory : "
          + e.getMessage());
    }
  }
View Full Code Here

       
        // Save children links found.
        linkChildren.put(file.getLink().toString(), children);

      } catch (Exception e) {
        throw new ProtocolException("Failed to get children links for " + file
            + " : " + e.getMessage(), e);
      }
    }
    return children;
  }
View Full Code Here

        homeFolder = currentFolder = store.getDefaultFolder();
      else {
        homeFolder = currentFolder = store.getFolder(remotePath);
      }
    } catch (Exception e) {
      throw new ProtocolException("Failed to change directory to '"
          + file + "' : " + e.getMessage(), e);
    }
  }
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.