|
@@ -32,6 +32,7 @@ public class UpyunServiceImpl implements UpyunService {
|
|
|
UpYunClient upYunClient = UpyunSiteManager.getUpYunClientByUpyunId(upyunSite.getUpyunId());
|
|
|
|
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
|
+ path=disposePath(path);
|
|
|
UpYunPathInfo pathInfo = upYunClient.writeFile(path, in, md5);
|
|
|
return pathInfo;
|
|
|
}
|
|
@@ -46,6 +47,7 @@ public class UpyunServiceImpl implements UpyunService {
|
|
|
UpYunClient upYunClient = UpyunSiteManager.getUpYunClientByUpyunId(upyunSite.getUpyunId());
|
|
|
|
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
|
+ path=disposePath(path);
|
|
|
UpYunPathInfo pathInfo = upYunClient.writeFile(path, file, withMd5);
|
|
|
return pathInfo;
|
|
|
}
|
|
@@ -59,6 +61,7 @@ public class UpyunServiceImpl implements UpyunService {
|
|
|
UpYunClient upYunClient = UpyunSiteManager.getUpYunClientByUpyunId(upyunSite.getUpyunId());
|
|
|
|
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
|
+ path=disposePath(path);
|
|
|
UpYunPathInfo pathInfo = upYunClient.writeFile(path, file, md5);
|
|
|
return pathInfo;
|
|
|
}
|
|
@@ -82,6 +85,7 @@ public class UpyunServiceImpl implements UpyunService {
|
|
|
UpYunClient upYunClient = UpyunSiteManager.getUpYunClientByUpyunId(upyunSite.getUpyunId());
|
|
|
|
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
|
+ path=disposePath(path);
|
|
|
YunHttpRequest request = upYunClient.buildUpYunHttpRequest(path, md5);
|
|
|
return request;
|
|
|
}
|
|
@@ -93,5 +97,14 @@ public class UpyunServiceImpl implements UpyunService {
|
|
|
|
|
|
upYunClient.deleteFile(filePath);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ private String disposePath(String path) {
|
|
|
+ for(;;) {
|
|
|
+ if(path.startsWith("/")) {
|
|
|
+ path=path.substring(1);
|
|
|
+ }else {
|
|
|
+ return "/"+path;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|