Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/applicationContext.xml
===================================================================
diff -u -r6e5832d17263bc6c6f7683733e91e22f97eab569 -r643f195ff0e9d4ca74456bc9dbf835b15c7f513d
--- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/applicationContext.xml (.../applicationContext.xml) (revision 6e5832d17263bc6c6f7683733e91e22f97eab569)
+++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/applicationContext.xml (.../applicationContext.xml) (revision 643f195ff0e9d4ca74456bc9dbf835b15c7f513d)
@@ -117,8 +117,6 @@
-
- /tmp/repository
-
+
Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/file/FileDAO.java
===================================================================
diff -u -r8fe03be36398979de21121946d3ce1139dd39680 -r643f195ff0e9d4ca74456bc9dbf835b15c7f513d
--- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/file/FileDAO.java (.../FileDAO.java) (revision 8fe03be36398979de21121946d3ce1139dd39680)
+++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/dao/file/FileDAO.java (.../FileDAO.java) (revision 643f195ff0e9d4ca74456bc9dbf835b15c7f513d)
@@ -32,6 +32,8 @@
import org.apache.log4j.Logger;
import org.lamsfoundation.lams.contentrepository.FileException;
import org.lamsfoundation.lams.contentrepository.dao.IFileDAO;
+import org.lamsfoundation.lams.util.Configuration;
+import org.lamsfoundation.lams.util.ConfigurationKeys;
/**
@@ -42,7 +44,6 @@
*/
public class FileDAO implements IFileDAO {
- private String repositoryLocation;
protected Logger log = Logger.getLogger(FileDAO.class);
/**
@@ -51,11 +52,11 @@
*/
protected String[] generateFilePath(Long uuid, Long versionId)
throws FileException {
-
- if ( repositoryLocation == null )
+
+ String directoryPath = Configuration.get(ConfigurationKeys.CONTENT_REPOSITORY_PATH);
+
+ if ( directoryPath == null )
throw new FileException("Repository location unknown. Cannot access files. This should have been configured in the Spring context.");
-
- String directoryPath = repositoryLocation;
if ( uuid == null || uuid.longValue() < 1 )
throw new FileException("Unable to generate new filename for uuid="+uuid);
@@ -231,18 +232,4 @@
File file = new File( getFilePath(uuid, versionId));
return ( file.exists() );
}
-
- /* ***************** Getters and setters for Spring *****************/
- /**
- * @return Returns the repositoryLocation.
- */
- public String getRepositoryLocation() {
- return repositoryLocation;
- }
- /**
- * @param repositoryLocation The repositoryLocation to set.
- */
- public void setRepositoryLocation(String repositoryLocation) {
- this.repositoryLocation = repositoryLocation;
- }
}