mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Cleanup of goofy looking paths.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5656 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -674,10 +674,10 @@ public class DeploymentServiceImpl implements DeploymentService
|
||||
// This means no entry on src so delete.
|
||||
if (src == null)
|
||||
{
|
||||
String newDstPath = dstPath + '/' + dst.getName();
|
||||
String newDstPath = extendPath(dstPath, dst.getName());
|
||||
service.delete(ticket, newDstPath);
|
||||
DeploymentEvent event = new DeploymentEvent(DeploymentEvent.Type.DELETED,
|
||||
new Pair<Integer, String>(version, srcPath + '/' + dst.getName()),
|
||||
new Pair<Integer, String>(version, extendPath(srcPath, dst.getName())),
|
||||
newDstPath);
|
||||
if (callback != null)
|
||||
{
|
||||
@@ -713,7 +713,7 @@ public class DeploymentServiceImpl implements DeploymentService
|
||||
if (src.isFile())
|
||||
{
|
||||
copyFile(service, ticket, report, callback, version, src,
|
||||
dstPath + '/' + dst.getName());
|
||||
extendPath(dstPath, dst.getName()));
|
||||
src = null;
|
||||
dst = null;
|
||||
continue;
|
||||
@@ -725,7 +725,7 @@ public class DeploymentServiceImpl implements DeploymentService
|
||||
{
|
||||
service.setGuid(ticket, dstPath, src.getGuid());
|
||||
}
|
||||
deployDirectoryPush(service, ticket, report, callback, version, src.getPath(), dstPath + '/' + dst.getName());
|
||||
deployDirectoryPush(service, ticket, report, callback, version, src.getPath(), extendPath(dstPath, dst.getName()));
|
||||
src = null;
|
||||
dst = null;
|
||||
continue;
|
||||
@@ -737,10 +737,10 @@ public class DeploymentServiceImpl implements DeploymentService
|
||||
}
|
||||
// diff > 0
|
||||
// Destination is missing in source, delete it.
|
||||
String newDstPath = dstPath + '/' + dst.getName();
|
||||
String newDstPath = extendPath(dstPath, dst.getName());
|
||||
service.delete(ticket, newDstPath);
|
||||
DeploymentEvent event = new DeploymentEvent(DeploymentEvent.Type.DELETED,
|
||||
new Pair<Integer, String>(version, srcPath + '/' + dst.getName()),
|
||||
new Pair<Integer, String>(version, extendPath(srcPath, dst.getName())),
|
||||
newDstPath);
|
||||
if (callback != null)
|
||||
{
|
||||
@@ -801,7 +801,7 @@ public class DeploymentServiceImpl implements DeploymentService
|
||||
DeploymentReport report, DeploymentCallback callback,
|
||||
int version, AVMNodeDescriptor src, String parentPath)
|
||||
{
|
||||
String dstPath = parentPath + '/' + src.getName();
|
||||
String dstPath = extendPath(parentPath, src.getName());
|
||||
if (src.isFile())
|
||||
{
|
||||
copyFile(service, ticket, report, callback, version, src, dstPath);
|
||||
@@ -823,4 +823,19 @@ public class DeploymentServiceImpl implements DeploymentService
|
||||
copy(service, ticket, report, callback, version, child, dstPath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extend a path.
|
||||
* @param path
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
private String extendPath(String path, String name)
|
||||
{
|
||||
if (path.endsWith("/"))
|
||||
{
|
||||
return path + name;
|
||||
}
|
||||
return path + '/' + name;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user