View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.oodt.cas.protocol;
18  
19  //OODT imports
20  import org.apache.oodt.cas.protocol.auth.Authentication;
21  import org.apache.oodt.cas.protocol.exceptions.ProtocolException;
22  import org.apache.oodt.cas.protocol.util.ProtocolFileFilter;
23  
24  //JDK imports
25  import java.io.File;
26  import java.util.List;
27  
28  /**
29   * Interface for communication over different transfer protocols
30   * 
31   * @author bfoster
32   * @version $Revision$
33   */
34  public interface Protocol {
35  
36      public void connect(String host, Authentication authentication) throws ProtocolException;
37      
38      public void close() throws ProtocolException;
39  
40      public boolean connected();
41      
42      public void cd(ProtocolFile file) throws ProtocolException;
43  
44      public void cdRoot() throws ProtocolException;
45  
46      public void cdHome() throws ProtocolException;
47  
48      public void get(ProtocolFile fromFile, File toFile) throws ProtocolException;
49  
50      public void put(File fromFile, ProtocolFile toFile) throws ProtocolException;
51      
52      public ProtocolFile pwd() throws ProtocolException;
53  
54      public List<ProtocolFile> ls() throws ProtocolException;
55  
56      public List<ProtocolFile> ls(ProtocolFileFilter filter) throws ProtocolException;
57  
58      public void delete(ProtocolFile file) throws ProtocolException;
59  
60  }