diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-13 10:08:31 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-13 10:24:10 +0200 |
commit | 34bcf9b498bccb5c924f4cec850ff15d88df6f07 (patch) | |
tree | 4d9604ec8c3b73639338ec45a0618b5daa5cf0ed /scripting/java/org | |
parent | 347926e8e57c1825261daa46c1886aa2ebf9571b (diff) |
java: remove dead methods
found by UCDetector
Change-Id: I219caa8e680dba5a395541a778df6144841c4dde
Diffstat (limited to 'scripting/java/org')
4 files changed, 2 insertions, 103 deletions
diff --git a/scripting/java/org/openoffice/idesupport/JavaFinder.java b/scripting/java/org/openoffice/idesupport/JavaFinder.java index 7ef66c62dc9e..1594b9fd37c5 100644 --- a/scripting/java/org/openoffice/idesupport/JavaFinder.java +++ b/scripting/java/org/openoffice/idesupport/JavaFinder.java @@ -49,15 +49,7 @@ public class JavaFinder implements MethodFinder { this.classpath = classpath; } - public static JavaFinder getInstance() { - if (finder == null) { - synchronized(JavaFinder.class) { - if (finder == null) - finder = new JavaFinder(); - } - } - return finder; - } + public static JavaFinder getInstance(List<String> classpath) { return new JavaFinder(classpath); diff --git a/scripting/java/org/openoffice/idesupport/LocalOffice.java b/scripting/java/org/openoffice/idesupport/LocalOffice.java index f28e36ad3c9e..07b502c546ab 100644 --- a/scripting/java/org/openoffice/idesupport/LocalOffice.java +++ b/scripting/java/org/openoffice/idesupport/LocalOffice.java @@ -32,41 +32,7 @@ import java.util.ArrayList; */ public class LocalOffice { - /** - * Creates an instance of the local office connection. - * - * @param parent is an application specific class loader. - * @param officePath is a platform specific path string - * to the office distribution. - * @param port is a communication port. - */ - public static final LocalOffice create( - ClassLoader parent, String officePath, int port) - { - ArrayList<String> path = new ArrayList<String>(); - path.add(officePath + "/program/classes/ridl.jar"); - path.add(officePath + "/program/classes/jurt.jar"); - path.add(officePath + "/program/classes/unoil.jar"); - path.add(officePath + "/program/classes/juh.jar"); - path.add(System.getProperties().getProperty("netbeans.home") + - File.separator + "modules" + - File.separator + "ext" + - File.separator + "localoffice.jar"); - // commented out so code will compile - // ClassLoader appcl = new DefaultScriptClassLoader(parent, path); - ClassLoader appcl = path.getClass().getClassLoader(); - Class clazz = null; - LocalOffice office = null; - try { - clazz = appcl.loadClass( - "org.openoffice.idesupport.localoffice.LocalOfficeImpl"); - office = (LocalOffice)clazz.newInstance(); - office.connect(officePath, port); - } catch (java.lang.Exception exp) { - office = null; - } - return office; - } + /** * Connects to the running office. diff --git a/scripting/java/org/openoffice/idesupport/OfficeInstallation.java b/scripting/java/org/openoffice/idesupport/OfficeInstallation.java index d8b337fb3ea1..586d3a2d47ef 100644 --- a/scripting/java/org/openoffice/idesupport/OfficeInstallation.java +++ b/scripting/java/org/openoffice/idesupport/OfficeInstallation.java @@ -65,30 +65,15 @@ public class OfficeInstallation implements java.io.Serializable { return path; } - public String getPath(String name) { - if (!name.startsWith(File.separator)) - name = File.separator + name; - return path + name; - } public String getURL() { return url; } - public String getURL(String name) { - if (System.getProperty("os.name").startsWith("Windows")) - name = name.replace(File.separatorChar, '/'); - if (!name.startsWith("/")) - name = "/" + name; - return url + name; - } - public boolean hasFramework() { - return hasFW; - } public boolean supportsFramework() { return true; diff --git a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java index bd5eb48c3f20..30cf598a706a 100644 --- a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java +++ b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java @@ -51,35 +51,11 @@ public class ParcelZipper return zipper; } - public String zipParcel(File basedir) throws IOException { - File targetfile, targetdir; - if (basedir.getName().equals(CONTENTS_DIRNAME)) - targetdir = basedir.getParentFile(); - else - targetdir = basedir; - targetfile = new File(targetdir, targetdir.getName() + "." + PARCEL_EXTENSION); - return zipParcel(basedir, targetfile, DEFAULT_FILTER); - } - public String zipParcel(File basedir, File targetfile) throws IOException { - return zipParcel(basedir, targetfile, DEFAULT_FILTER); - } - public String zipParcel(File basedir, FileFilter filter) throws IOException { - File targetfile, targetdir; - - if (basedir.getName().equals(CONTENTS_DIRNAME)) - targetdir = basedir.getParentFile(); - else - targetdir = basedir; - - targetfile = new File(targetdir, targetdir.getName() + "." + PARCEL_EXTENSION); - - return zipParcel(basedir, targetfile, filter); - } private String zipParcel(File basedir, File targetfile, FileFilter filter) throws IOException { @@ -155,18 +131,7 @@ public class ParcelZipper } } - public boolean isOverwriteNeeded(File parcel, File target) - throws IOException - { - boolean result; - - if (target.isDirectory()) - result = isDirectoryOverwriteNeeded(parcel, target); - else - result = isDocumentOverwriteNeeded(parcel, target); - return result; - } private boolean isDirectoryOverwriteNeeded(File parcel, File target) { String parcelDir = getParcelDirFromParcelZip(parcel.getName()); @@ -218,16 +183,7 @@ public class ParcelZipper return result; } - public String deployParcel(File parcel, File target) - throws IOException { - String output = null; - if (target.isDirectory()) - output = unzipToDirectory(parcel, target); - else - output = unzipToZip(parcel, target); - return output; - } private String getParcelDirFromParcelZip(String zipname) { String result = zipname.substring(0, zipname.lastIndexOf(".")); |