From ce564c209bc4cc92595876399be544c55f04e82a Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Sun, 13 Sep 2015 07:43:05 -0400 Subject: [PATCH] removed deprecated/unused methods --- .../dependencycheck/utils/FileUtils.java | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java b/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java index b1c5b3fba..ba3f06c08 100644 --- a/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java +++ b/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java @@ -102,46 +102,6 @@ public final class FileUtils { return tempFile; } - /** - * Returns the data directory. If a path was specified in dependencycheck.properties or was specified using the Settings - * object, and the path exists, that path will be returned as a File object. If it does not exist, then a File object will be - * created based on the file location of the JAR containing the specified class. - * - * @param configuredFilePath the configured relative or absolute path - * @param clazz the class to resolve the path - * @return a File object - * @throws IOException is thrown if the path could not be decoded - * @deprecated This method should no longer be used. See the implementation in dependency-check-cli/App.java to see how the - * data directory should be set. - */ - @java.lang.Deprecated - public static File getDataDirectory(String configuredFilePath, Class clazz) throws IOException { - final File file = new File(configuredFilePath); - if (file.isDirectory() && file.canWrite()) { - return new File(file.getCanonicalPath()); - } else { - final File exePath = getPathToJar(clazz); - return new File(exePath, configuredFilePath); - } - } - - /** - * Retrieves the physical path to the parent directory containing the provided class. For example, if a JAR file contained a - * class org.something.clazz this method would return the parent directory of the JAR file. - * - * @param clazz the class to determine the parent directory of - * @return the parent directory of the file containing the specified class. - * @throws UnsupportedEncodingException thrown if UTF-8 is not supported. - * @deprecated this should no longer be used. - */ - @java.lang.Deprecated - public static File getPathToJar(Class clazz) throws UnsupportedEncodingException { - final String filePath = clazz.getProtectionDomain().getCodeSource().getLocation().getPath(); - final String decodedPath = URLDecoder.decode(filePath, "UTF-8"); - final File jarPath = new File(decodedPath); - return jarPath.getParentFile(); - } - /** * Return the bit bucket for the OS. '/dev/null' for Unix and 'NUL' for Windows *