public static Path resolveWorkspacePath()

in src/main/java/com/amazonaws/codepipeline/jenkinsplugin/CompressionTools.java [202:238]


    public static Path resolveWorkspacePath(
            final File workspace,
            final String outputPath)
            throws FileNotFoundException {
        Path path = null;

        if (workspace != null) {
            if (!outputPath.contains(workspace.getAbsolutePath())) {
                path = Paths.get(workspace.getAbsolutePath(), outputPath);
            }
            else {
                path = Paths.get(outputPath);
            }
        }
        else {
            final String attemptPath;
            final URL tmp = CompressionTools.class.getClassLoader().getResource("");
            if (tmp != null) {
                attemptPath = tmp.getPath();
            }
            else {
                attemptPath = "";
            }

            if (attemptPath != null) {
                path = Paths.get(attemptPath);
            }
        }

        if (path == null) {
            throw new FileNotFoundException("Could not resolve path for " + outputPath);
        }

        path.resolve(outputPath);

        return path;
    }