Exemplo n.º 1
0
 public URL getLocalURL(String location) throws IOException {
   if (isUpToDate(location)) {
     return local.getURL(location);
   }
   Map<String, Object> metadata = new HashMap<String, Object>();
   InputStream is = remote.getContents(location, metadata);
   local.storeData(location, is, metadata);
   return local.getURL(location);
 }
Exemplo n.º 2
0
 public boolean isUpToDate(String location) throws IOException {
   if (!hasLocal(location)) {
     return false;
   }
   long localMod = local.getLocalModificationDate(location);
   long remoteMod = remote.getRemoteModificationDate(location);
   if (localMod >= remoteMod) {
     return true;
   }
   return false;
 }
Exemplo n.º 3
0
 public URL getRemoteURL(String location) throws IOException {
   return remote.getURL(location);
 }