Exemplo n.º 1
0
 /**
  * @param hashList Map
  * @param US UpdateStub
  * @return String
  */
 private static String getLocalFileURI(java.util.Map hashList, UpdateStub US) {
   String FileName = null;
   String PathName = (String) hashList.get("user.home");
   String Separator = System.getProperty("file.separator");
   PathName =
       PathName + UpdateObject.getCodeSpace() + Separator + US.getStubPathName(false) + Separator;
   File dirFile = new File(PathName);
   if (!dirFile.exists()) {
     dirFile.mkdirs();
   }
   FileName = PathName + US.getStubFileName();
   return FileName;
 }
Exemplo n.º 2
0
 /**
  * @param Codebase String
  * @param US UpdateStub
  * @return String
  */
 private static String getRemoteFileURI(String Codebase, UpdateStub US) {
   String PathName = null;
   if (Codebase.toLowerCase().startsWith("file")) {
     PathName = Codebase + US.getStubPathName(true) + US.getStubFileName();
   } else {
     if (US.getString("svr", null) == null) { // add by fsz
       PathName =
           Codebase
               + UpdateObject.CODE_SPACE
               + "/"
               + US.getStubPathName(true)
               + US.getStubFileName();
     } else {
       //        PathName =US.getString("svr","")+US.getString("urlpath","")+US.getStubFileName();
       PathName =
           US.getString("svr", "")
               + UpdateObject.CODE_SPACE
               + "/"
               + US.getStubPathName(true)
               + US.getStubFileName();
     }
   }
   return PathName;
 }