1 /*****************************************************************************
5 * Creation date 06.10.2012
8 *****************************************************************************/
10 package org.splat.service.technical;
14 import org.splat.dal.bo.kernel.User;
17 * The service for working with the repository. Provides paths to download and vault directory.
19 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
21 public class RepositoryServiceImpl implements RepositoryService {
24 * The repository root path.
26 private String _basepath;
30 * @see org.splat.service.technical.RepositoryService#getRepositoryIndexDirectory()
32 public File getRepositoryIndexDirectory() {
33 return new File(getBasepath() + "lucin/");
38 * @see org.splat.service.technical.RepositoryService#getRepositoryVaultPath()
40 public String getRepositoryVaultPath() {
41 return (getBasepath() + "vault/");
46 * @see org.splat.service.technical.RepositoryService#getDownloadDirectory(org.splat.dal.bo.kernel.User)
48 public File getDownloadDirectory(final User user) {
49 StringBuffer path = new StringBuffer(_basepath).append("downloads/")
50 .append(user.getUsername()).append("/");
51 return new File(path.toString());
56 * @see org.splat.service.technical.RepositoryService#getDownloadDirectory(long)
58 public File getDownloadDirectory(final long userId) {
59 StringBuffer path = new StringBuffer(_basepath).append("downloads/")
60 .append(userId).append("/");
61 return new File(path.toString());
66 * @see org.splat.service.technical.RepositoryService#getTemplatePath()
68 public String getTemplatePath() {
69 return (_basepath + "templates/");
74 * @see org.splat.service.technical.RepositoryService#getBasepath()
76 public String getBasepath() {
82 * @see org.splat.service.technical.RepositoryService#setBasepath(java.lang.String)
84 public void setBasepath(final String basepath) {