View Javadoc

1   package fr.in2p3.jsaga.impl.job.staging;
2   
3   import fr.in2p3.jsaga.Base;
4   import org.ogf.saga.url.URL;
5   
6   /* ***************************************************
7    * *** Centre de Calcul de l'IN2P3 - Lyon (France) ***
8    * ***             http://cc.in2p3.fr/             ***
9    * ***************************************************
10   * File:   AbstractDataStaging
11   * Author: Sylvain Reynaud (sreynaud@in2p3.fr)
12   * Date:   20 mai 2009
13   * ***************************************************
14   * Description:                                      */
15  /**
16   *
17   */
18  public abstract class AbstractDataStaging {
19      protected static final String JSAGA_FACTORY = Base.getSagaFactory();
20      protected static final boolean INPUT = true;
21      protected static final boolean OUTPUT = false;
22  
23      protected URL m_localURL;
24      protected boolean m_append;
25  
26      protected AbstractDataStaging(URL localURL, boolean append) {
27          m_localURL = localURL;
28          m_append = append;
29      }
30  
31      public boolean isSubdirOf(URL baseURL) {
32          return m_localURL.toString().startsWith(baseURL.toString()+"/");
33      }
34  
35      public String getLocalProtocol() {
36          return m_localURL.getScheme();
37      }
38  
39      public abstract String getWorkerProtocol();
40      public abstract boolean isInput();
41  }