Commit 0cc7a50e authored by Adam Knapp's avatar Adam Knapp
Browse files

Fixing InvokeBuild input argument check


Signed-off-by: Adam Knapp's avatarAdam Knapp <adam.knapp@ericsson.com>
parent 2c60ae86
......@@ -257,12 +257,13 @@ public final class PathUtil {
* @see java.io.File#getCanonicalPath
*/
public static boolean isValidFilePath(String path) {
File f = new File(path);
try {
File f = new File(path);
f.getCanonicalPath();
return true;
}
catch (IOException e) {
} catch (IOException e) {
return false;
} catch (NullPointerException e) {
return false;
}
}
......
......@@ -94,7 +94,7 @@ public final class InvokeBuild implements IApplication {
}
projectName = args[i];
}
if (!PathUtil.isValidFilePath(pathToJar)) {
if (!StringUtils.isNullOrEmpty(pathToJar) && !PathUtil.isValidFilePath(pathToJar)) {
System.out.println("The path `" + pathToJar + "' is not valid.");
return closeWorkspace();
}
......@@ -103,7 +103,7 @@ public final class InvokeBuild implements IApplication {
if (project != null && project.getName().equals(projectName)) {
try {
project.refreshLocal(IResource.DEPTH_INFINITE, null);
if (!StringUtils.isNullOrEmpty(pathToJar) && TITANJavaBuilder.isBuilderEnabled(project)) {
if (TITANJavaBuilder.isBuilderEnabled(project)) {
addJarBuilder(project, pathToJar);
}
project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment