|
@@ -23,10 +23,11 @@ public class UpyunServiceImpl implements UpyunService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public UpYunPathInfo writeFile(String siteId, UpyunPathEnvironmentInfo env, InputStream in) {
|
|
public UpYunPathInfo writeFile(String siteId, UpyunPathEnvironmentInfo env, InputStream in) {
|
|
|
|
+
|
|
env.setTimeMillis(String.valueOf(System.currentTimeMillis()));
|
|
env.setTimeMillis(String.valueOf(System.currentTimeMillis()));
|
|
|
|
|
|
UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
|
|
UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
|
|
- UpYunClient upYunClient = UpyunSiteManager.getUpYunClient(siteId);
|
|
|
|
|
|
+ UpYunClient upYunClient = UpyunSiteManager.getUpYunClientByUpyunId(upyunSite.getUpyunId());
|
|
|
|
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
UpYunPathInfo pathInfo = upYunClient.writeFile(path, in);
|
|
UpYunPathInfo pathInfo = upYunClient.writeFile(path, in);
|
|
@@ -35,10 +36,11 @@ public class UpyunServiceImpl implements UpyunService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public UpYunPathInfo writeFile(String siteId, UpyunPathEnvironmentInfo env, File file) {
|
|
public UpYunPathInfo writeFile(String siteId, UpyunPathEnvironmentInfo env, File file) {
|
|
|
|
+
|
|
env.setTimeMillis(String.valueOf(System.currentTimeMillis()));
|
|
env.setTimeMillis(String.valueOf(System.currentTimeMillis()));
|
|
|
|
|
|
UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
|
|
UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
|
|
- UpYunClient upYunClient = UpyunSiteManager.getUpYunClient(siteId);
|
|
|
|
|
|
+ UpYunClient upYunClient = UpyunSiteManager.getUpYunClientByUpyunId(upyunSite.getUpyunId());
|
|
|
|
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
UpYunPathInfo pathInfo = upYunClient.writeFile(path, file);
|
|
UpYunPathInfo pathInfo = upYunClient.writeFile(path, file);
|
|
@@ -47,8 +49,9 @@ public class UpyunServiceImpl implements UpyunService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void delete(String siteId, UpyunPathEnvironmentInfo env) {
|
|
public void delete(String siteId, UpyunPathEnvironmentInfo env) {
|
|
|
|
+
|
|
UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
|
|
UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
|
|
- UpYunClient upYunClient = UpyunSiteManager.getUpYunClient(siteId);
|
|
|
|
|
|
+ UpYunClient upYunClient = UpyunSiteManager.getUpYunClientByUpyunId(upyunSite.getUpyunId());
|
|
|
|
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
upYunClient.deleteFile(path);
|
|
upYunClient.deleteFile(path);
|
|
@@ -56,9 +59,11 @@ public class UpyunServiceImpl implements UpyunService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public UpYunSign buildUpYunSign(String siteId, UpyunPathEnvironmentInfo env) {
|
|
public UpYunSign buildUpYunSign(String siteId, UpyunPathEnvironmentInfo env) {
|
|
|
|
+
|
|
env.setTimeMillis(String.valueOf(System.currentTimeMillis()));
|
|
env.setTimeMillis(String.valueOf(System.currentTimeMillis()));
|
|
|
|
+
|
|
UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
|
|
UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
|
|
- UpYunClient upYunClient = UpyunSiteManager.getUpYunClient(siteId);
|
|
|
|
|
|
+ UpYunClient upYunClient = UpyunSiteManager.getUpYunClientByUpyunId(upyunSite.getUpyunId());
|
|
|
|
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
UpYunSign sign = upYunClient.buildUpYunSign(path);
|
|
UpYunSign sign = upYunClient.buildUpYunSign(path);
|