mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Coding standards.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34548 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,7 +22,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationContext;
|
import javax.servlet.ServletException;
|
||||||
|
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.tenant.TenantService;
|
import org.alfresco.repo.tenant.TenantService;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
@@ -42,22 +43,19 @@ import org.alfresco.util.PropertyCheck;
|
|||||||
public class MTNodesCache2
|
public class MTNodesCache2
|
||||||
{
|
{
|
||||||
private boolean enabled = false;
|
private boolean enabled = false;
|
||||||
|
|
||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
|
|
||||||
private SearchService searchService;
|
private SearchService searchService;
|
||||||
|
|
||||||
private NamespaceService namespaceService;
|
private NamespaceService namespaceService;
|
||||||
|
|
||||||
private TenantService tenantService;
|
private TenantService tenantService;
|
||||||
|
|
||||||
private Map<String, NodeRef> nodesCache = new ConcurrentHashMap<String, NodeRef>();
|
private Map<String, NodeRef> nodesCache = new ConcurrentHashMap<String, NodeRef>();
|
||||||
|
|
||||||
private NodeRef defaultNode = null;
|
private NodeRef defaultNode = null;
|
||||||
|
|
||||||
private String storeName;
|
private String storeName;
|
||||||
private String rootPath;
|
private String rootPath;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spring bean init method
|
||||||
|
*/
|
||||||
public void init()
|
public void init()
|
||||||
{
|
{
|
||||||
PropertyCheck.mandatory(this, "nodeService", getNodeService());
|
PropertyCheck.mandatory(this, "nodeService", getNodeService());
|
||||||
@@ -72,6 +70,7 @@ public class MTNodesCache2
|
|||||||
{
|
{
|
||||||
this.nodeService = nodeService;
|
this.nodeService = nodeService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NodeService getNodeService()
|
public NodeService getNodeService()
|
||||||
{
|
{
|
||||||
return nodeService;
|
return nodeService;
|
||||||
@@ -106,10 +105,9 @@ public class MTNodesCache2
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onBootstrap()
|
public void onBootstrap()
|
||||||
{
|
{
|
||||||
if(!enabled)
|
if (!enabled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -147,7 +145,6 @@ public class MTNodesCache2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Returns the name of the store
|
* @return Returns the name of the store
|
||||||
* @throws ServletException if the store name was not set
|
* @throws ServletException if the store name was not set
|
||||||
@@ -156,6 +153,7 @@ public class MTNodesCache2
|
|||||||
{
|
{
|
||||||
return storeName;
|
return storeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStoreName(String storeName)
|
public void setStoreName(String storeName)
|
||||||
{
|
{
|
||||||
this.storeName = storeName;
|
this.storeName = storeName;
|
||||||
@@ -169,6 +167,7 @@ public class MTNodesCache2
|
|||||||
{
|
{
|
||||||
return rootPath;
|
return rootPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRootPath(String rootPath)
|
public void setRootPath(String rootPath)
|
||||||
{
|
{
|
||||||
this.rootPath = rootPath;
|
this.rootPath = rootPath;
|
||||||
@@ -203,15 +202,14 @@ public class MTNodesCache2
|
|||||||
{
|
{
|
||||||
return tenantService;
|
return tenantService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getEnabled()
|
public boolean getEnabled()
|
||||||
{
|
{
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnabled(boolean enabled)
|
public void setEnabled(boolean enabled)
|
||||||
{
|
{
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -36,7 +36,7 @@ import org.springframework.extensions.surf.util.URLEncoder;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The WebDav client is used by the repository to generate webdav URLs
|
* The WebDav client is used by the repository to generate webdav URLs
|
||||||
*
|
* <p>
|
||||||
* This is a bog standard spring bean for the repo side of WebDav.
|
* This is a bog standard spring bean for the repo side of WebDav.
|
||||||
*
|
*
|
||||||
* @See org.alfresco.repo.webdav.WebDavServlet the server side of webdav.
|
* @See org.alfresco.repo.webdav.WebDavServlet the server side of webdav.
|
||||||
@@ -45,30 +45,23 @@ import org.springframework.extensions.surf.util.URLEncoder;
|
|||||||
*/
|
*/
|
||||||
public class WebDavServiceImpl implements WebDavService
|
public class WebDavServiceImpl implements WebDavService
|
||||||
{
|
{
|
||||||
private boolean enabled = false;
|
public static final String WEBDAV_PREFIX = "webdav";
|
||||||
|
|
||||||
|
private static Log logger = LogFactory.getLog(WebDavServiceImpl.class);
|
||||||
|
|
||||||
|
private boolean enabled = false;
|
||||||
|
|
||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
private DictionaryService dictionaryService;
|
private DictionaryService dictionaryService;
|
||||||
private FileFolderService fileFolderService;
|
private FileFolderService fileFolderService;
|
||||||
|
|
||||||
|
|
||||||
private static Log logger = LogFactory.getLog(WebDavServiceImpl.class);
|
|
||||||
|
|
||||||
// Root nodes
|
// Root nodes
|
||||||
private MTNodesCache2 rootNode;
|
private MTNodesCache2 rootNode;
|
||||||
|
|
||||||
public static final String WEBDAV_PREFIX = "webdav";
|
|
||||||
|
|
||||||
public boolean getEnabled()
|
|
||||||
{
|
|
||||||
return enabled;
|
|
||||||
}
|
|
||||||
public void setEnabled(boolean enabled)
|
|
||||||
{
|
|
||||||
this.enabled = enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spring bean init method
|
||||||
|
*/
|
||||||
public void init()
|
public void init()
|
||||||
{
|
{
|
||||||
PropertyCheck.mandatory(this, "nodeService", getNodeService());
|
PropertyCheck.mandatory(this, "nodeService", getNodeService());
|
||||||
@@ -85,9 +78,11 @@ public class WebDavServiceImpl implements WebDavService
|
|||||||
*/
|
*/
|
||||||
public String getWebdavUrl(NodeRef nodeRef)
|
public String getWebdavUrl(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
if(!enabled)
|
String url = "";
|
||||||
|
|
||||||
|
if (!enabled)
|
||||||
{
|
{
|
||||||
return "";
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -107,15 +102,14 @@ public class WebDavServiceImpl implements WebDavService
|
|||||||
path.append("/")
|
path.append("/")
|
||||||
.append(URLEncoder.encode(paths.get(i).getName()));
|
.append(URLEncoder.encode(paths.get(i).getName()));
|
||||||
}
|
}
|
||||||
return path.toString();
|
url = path.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException nodeErr)
|
catch (FileNotFoundException nodeErr)
|
||||||
{
|
{
|
||||||
// cannot build path if file no longer exists
|
// cannot build path if file no longer exists, return default
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
return "";
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,34 +132,51 @@ public class WebDavServiceImpl implements WebDavService
|
|||||||
return isDocument;
|
return isDocument;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getEnabled()
|
||||||
|
{
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnabled(boolean enabled)
|
||||||
|
{
|
||||||
|
this.enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
public void setNodeService(NodeService nodeService)
|
public void setNodeService(NodeService nodeService)
|
||||||
{
|
{
|
||||||
this.nodeService = nodeService;
|
this.nodeService = nodeService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NodeService getNodeService()
|
public NodeService getNodeService()
|
||||||
{
|
{
|
||||||
return nodeService;
|
return nodeService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDictionaryService(DictionaryService dictionaryService)
|
public void setDictionaryService(DictionaryService dictionaryService)
|
||||||
{
|
{
|
||||||
this.dictionaryService = dictionaryService;
|
this.dictionaryService = dictionaryService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DictionaryService getDictionaryService()
|
public DictionaryService getDictionaryService()
|
||||||
{
|
{
|
||||||
return dictionaryService;
|
return dictionaryService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFileFolderService(FileFolderService fileFolderService)
|
public void setFileFolderService(FileFolderService fileFolderService)
|
||||||
{
|
{
|
||||||
this.fileFolderService = fileFolderService;
|
this.fileFolderService = fileFolderService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileFolderService getFileFolderService()
|
public FileFolderService getFileFolderService()
|
||||||
{
|
{
|
||||||
return fileFolderService;
|
return fileFolderService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRootNode(MTNodesCache2 rootNode)
|
public void setRootNode(MTNodesCache2 rootNode)
|
||||||
{
|
{
|
||||||
this.rootNode = rootNode;
|
this.rootNode = rootNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MTNodesCache2 getRootNode()
|
public MTNodesCache2 getRootNode()
|
||||||
{
|
{
|
||||||
return rootNode;
|
return rootNode;
|
||||||
|
Reference in New Issue
Block a user