Third party subsystem failed to start if dir.root was a relative path

- due to Spring's conversion between Strings and Files
- now own custom conversion routine is used

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14782 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2009-06-18 10:50:36 +00:00
parent 65bdf48d96
commit 8d3d1d4a70

View File

@@ -43,11 +43,13 @@ public class OpenOfficeURI
* Instantiates a new open office URI.
*
* @param source
* the source file to convert to a URI
* the source file name to convert to a URI
* @throws IOException
* if the string cannot be resolved to a canonical file path
*/
public OpenOfficeURI(File source)
public OpenOfficeURI(String source) throws IOException
{
this.source = source;
this.source = new File(source).getCanonicalFile();
}
/*
@@ -57,15 +59,7 @@ public class OpenOfficeURI
@Override
public String toString()
{
String absolute;
try
{
absolute = this.source.getCanonicalPath();
}
catch (IOException e)
{
throw new RuntimeException(e);
}
String absolute = this.source.getAbsolutePath();
if (File.separatorChar != '/')
{
absolute = absolute.replace(File.separatorChar, '/');