mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fix/repo-4792 - Alfresco/transforms and alfresco/renditions can't read path-to-jar on Windows systems (#176)
Make path to .jar containing .json config for alfresco/transforms and alfresco/renditions OS agnostic.
This commit is contained in:
committed by
GitHub
parent
5e552afc4f
commit
9951d054d9
@@ -43,4 +43,4 @@ jobs:
|
||||
# Add email to link commits to user
|
||||
- git config user.email "${GIT_EMAIL}"
|
||||
# Skip building of release commits
|
||||
- mvn --batch-mode -q -DscmCommentPrefix="[maven-release-plugin][skip ci] " -Dusername="${GIT_USERNAME}" -Dpassword="${GIT_PASSWORD}" -DskipTests -Darguments=-DskipTests release:clean release:prepare release:perform
|
||||
- mvn --batch-mode -q -DscmCommentPrefix="[maven-release-plugin][skip ci] " -Dusername="${GIT_USERNAME}" -Dpassword="${GIT_PASSWORD}" -DskipTests -Darguments=-DskipTests release:clean release:prepare release:perform
|
||||
|
@@ -37,6 +37,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -81,7 +82,7 @@ public abstract class ConfigFileFinder
|
||||
AtomicBoolean somethingRead = new AtomicBoolean(false);
|
||||
|
||||
// Try reading resources in a jar
|
||||
final File jarFile = new File(getClass().getProtectionDomain().getCodeSource().getLocation().getPath());
|
||||
final File jarFile = new File(getClass().getProtectionDomain().getCodeSource().getLocation().toURI());
|
||||
if (jarFile.isFile())
|
||||
{
|
||||
readFromJar(jarFile, path, log, successReadingConfig, somethingRead);
|
||||
@@ -108,7 +109,7 @@ public abstract class ConfigFileFinder
|
||||
log.debug("No config read from "+path);
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
catch (IOException | URISyntaxException e)
|
||||
{
|
||||
log.error("Error reading from "+path, e);
|
||||
successReadingConfig.set(false);
|
||||
|
Reference in New Issue
Block a user