diff options
author | Tomas O'Connor <toconnor@openoffice.org> | 2002-11-26 11:46:48 +0000 |
---|---|---|
committer | Tomas O'Connor <toconnor@openoffice.org> | 2002-11-26 11:46:48 +0000 |
commit | 18e78c160c94edb8dc544cd1d52ec9bec880b2e2 (patch) | |
tree | 4bd70a78a4698de64e31968a01f687b416d13e74 | |
parent | 5d8c40bc2e51ea3973df966cb312904f42c2a58c (diff) |
Update all instances of OpenOffice and StarOffice to OpenOffice.org.
Ensure that ZipFile instances are closed.
15 files changed, 85 insertions, 53 deletions
diff --git a/scripting/java/org/openoffice/idesupport/OfficeDocument.java b/scripting/java/org/openoffice/idesupport/OfficeDocument.java index 13a3db2698c3..397e3678aee1 100644 --- a/scripting/java/org/openoffice/idesupport/OfficeDocument.java +++ b/scripting/java/org/openoffice/idesupport/OfficeDocument.java @@ -2,9 +2,9 @@ * * $RCSfile: OfficeDocument.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: toconnor $ $Date: 2002-11-13 17:44:06 $ + * last change: $Author: toconnor $ $Date: 2002-11-26 12:46:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,7 @@ public class OfficeDocument public static final String PARCEL_PREFIX_DIR = "Scripts/java/"; public static final String OFFICE_EXTENSIONS = "sxc,sxw"; public static final String ARCHIVE_TAG = "[PARCEL_FILE]"; + public static final String OFFICE_PRODUCT_NAME = "OpenOffice.org"; private static ParcelZipper zipper = ParcelZipper.getParcelZipper(); private File officeFile = null; @@ -88,7 +89,8 @@ public class OfficeDocument this.officeFile = officeFile; if( !checkIfOfficeDocument() ) { - throw new InvalidNameException("This is not a valid StarOffice document."); + throw new InvalidNameException("This is not a valid " + + OFFICE_PRODUCT_NAME + " document."); } } @@ -115,9 +117,11 @@ public class OfficeDocument public Enumeration getParcels() { java.util.Vector parcelEntries = new java.util.Vector(); + ZipFile zp = null; + try { - ZipFile zp = new ZipFile(this.officeFile); + zp = new ZipFile(this.officeFile); for (Enumeration officeEntries = zp.entries(); officeEntries.hasMoreElements(); ) { @@ -135,14 +139,22 @@ public class OfficeDocument } } } - catch(ZipException ze) - { + catch(ZipException ze) { ze.printStackTrace(); } - catch(IOException ioe) - { + catch(IOException ioe) { ioe.printStackTrace(); } + finally { + if (zp != null) { + try { + zp.close(); + } + catch (IOException asdf) { + } + } + } + return parcelEntries.elements(); } diff --git a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java index 2bd07e7ff0ad..6db67ce013c1 100644 --- a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java +++ b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java @@ -2,9 +2,9 @@ * * $RCSfile: ParcelZipper.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: toconnor $ $Date: 2002-11-13 17:44:17 $ + * last change: $Author: toconnor $ $Date: 2002-11-26 12:46:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -221,6 +221,7 @@ public class ParcelZipper private boolean isDocumentOverwriteNeeded(File parcel, File document) { ZipFile documentZip; + boolean result = false; try { documentZip = new ZipFile(document); @@ -234,9 +235,15 @@ public class ParcelZipper "/" + PARCEL_DESCRIPTOR_XML; if (documentZip.getEntry(name) != null) - return true; + result = true; - return false; + try { + documentZip.close(); + } + catch (IOException ioe) { + } + + return result; } public String deployParcel(File parcel, File target) @@ -484,22 +491,27 @@ public class ParcelZipper } ZipEntry original = documentZip.getEntry("META-INF/manifest.xml"); - if (original == null) { - return null; + if (original != null) { + try { + result = + new Manifest(documentZip.getInputStream(original), parser); + } + catch (IOException ioe) { + result = null; + } } try { - result = new Manifest(documentZip.getInputStream(original), parser); + documentZip.close(); } catch (IOException ioe) { - return null; } return result; } private Manifest addParcelToManifest(File document, File parcel) { - ZipFile documentZip, parcelZip; + ZipFile parcelZip; Manifest result = null; result = getManifestFromDocument(document); @@ -522,6 +534,12 @@ public class ParcelZipper result.add(prefix + entry.getName()); } + try { + parcelZip.close(); + } + catch (IOException ioe) { + } + return result; } diff --git a/scripting/java/org/openoffice/netbeans/modules/office/filesystem/Bundle.properties b/scripting/java/org/openoffice/netbeans/modules/office/filesystem/Bundle.properties index fe3f322f89f1..3137b89dde94 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/filesystem/Bundle.properties +++ b/scripting/java/org/openoffice/netbeans/modules/office/filesystem/Bundle.properties @@ -1,6 +1,6 @@ # Filesystems API # {0} - root path -LAB_invalid_file_system=invalid OpenOffice document {0} +LAB_invalid_file_system=invalid OpenOffice.org document {0} # {0} - root path LAB_valid_file_system={0} # {0} - root path @@ -39,5 +39,5 @@ EXC_file_could_not_be_renamed=File {3} could not be renamed to {4}. EXC_file_could_not_be_deleted=File {2} could not be deleted. PROP_readOnly=Read Only HINT_readOnly=Whether this filesystem should be writable, or read-only. -PROP_document=OpenOffice Document -HINT_document=OpenOffice Document (mount point) of this filesystem. +PROP_document=OpenOffice.org Document +HINT_document=OpenOffice.org Document (mount point) of this filesystem. diff --git a/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystem.java b/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystem.java index 6fa74594e4fd..f58e76e544c8 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystem.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystem.java @@ -2,9 +2,9 @@ * * $RCSfile: OpenOfficeDocFileSystem.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: toconnor $ $Date: 2002-11-13 17:44:28 $ + * last change: $Author: toconnor $ $Date: 2002-11-26 12:46:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,7 +82,7 @@ import org.openide.util.NbBundle; // - Acceptable document type identification before mount. /** - * OpenOffice Document filesystem. + * OpenOffice.org Document filesystem. * * @author misha <misha@openoffice.org> */ diff --git a/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystemBeanInfo.java b/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystemBeanInfo.java index bb37f940a4de..0d3f600a3dc3 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystemBeanInfo.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/filesystem/OpenOfficeDocFileSystemBeanInfo.java @@ -2,9 +2,9 @@ * * $RCSfile: OpenOfficeDocFileSystemBeanInfo.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: toconnor $ $Date: 2002-11-13 17:44:28 $ + * last change: $Author: toconnor $ $Date: 2002-11-26 12:46:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,7 +71,7 @@ import org.openide.util.NbBundle; import org.openide.util.Utilities; /** - * Description of the OpenOffice Document filesystem. + * Description of the OpenOffice.org Document filesystem. * * @author misha <misha@openoffice.org> */ diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataLoaderBeanInfo.java b/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataLoaderBeanInfo.java index a68901a66601..4cdf711a254b 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataLoaderBeanInfo.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataLoaderBeanInfo.java @@ -2,9 +2,9 @@ * * $RCSfile: OfficeDocumentDataLoaderBeanInfo.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: toconnor $ $Date: 2002-11-13 17:44:31 $ + * last change: $Author: toconnor $ $Date: 2002-11-26 12:46:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,9 +74,9 @@ public class OfficeDocumentDataLoaderBeanInfo extends SimpleBeanInfo { /* public PropertyDescriptor[] getPropertyDescriptors() { try { - PropertyDescriptor myProp = new PropertyDescriptor("myProp", StarOfficeDocumentDataLoader.class); - myProp.setDisplayName(NbBundle.getMessage(StarOfficeDocumentDataLoaderBeanInfo.class, "PROP_myProp")); - myProp.setShortDescription(NbBundle.getMessage(StarOfficeDocumentDataLoaderBeanInfo.class, "HINT_myProp")); + PropertyDescriptor myProp = new PropertyDescriptor("myProp", OfficeDocumentDataLoader.class); + myProp.setDisplayName(NbBundle.getMessage(OfficeDocumentDataLoaderBeanInfo.class, "PROP_myProp")); + myProp.setShortDescription(NbBundle.getMessage(OfficeDocumentDataLoaderBeanInfo.class, "HINT_myProp")); return new PropertyDescriptor[] {myProp}; } catch (IntrospectionException ie) { ErrorManager.getDefault().notify(ie); diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataNode.java b/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataNode.java index 5a81c78dd481..e35004a52c53 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataNode.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/OfficeDocumentDataNode.java @@ -2,9 +2,9 @@ * * $RCSfile: OfficeDocumentDataNode.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: toconnor $ $Date: 2002-11-13 17:44:31 $ + * last change: $Author: toconnor $ $Date: 2002-11-26 12:46:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -138,8 +138,8 @@ public class OfficeDocumentDataNode extends DataNode { if (set == null) { set = new Sheet.Set(); set.setName(ExecSupport.PROP_EXECUTION); - set.setDisplayName(NbBundle.getMessage(StarOfficeDocumentDataNode.class, "LBL_DataNode_exec_sheet")); - set.setShortDescription(NbBundle.getMessage(StarOfficeDocumentDataNode.class, "HINT_DataNode_exec_sheet")); + set.setDisplayName(NbBundle.getMessage(OfficeDocumentDataNode.class, "LBL_DataNode_exec_sheet")); + set.setShortDescription(NbBundle.getMessage(OfficeDocumentDataNode.class, "HINT_DataNode_exec_sheet")); } ((ExecSupport)getCookie(ExecSupport.class)).addProperties(set); // Maybe: diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDescriptorDataLoader.java b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDescriptorDataLoader.java index 0b7e970eea11..b174254fd3a0 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDescriptorDataLoader.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelDescriptorDataLoader.java @@ -2,9 +2,9 @@ * * $RCSfile: ParcelDescriptorDataLoader.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: toconnor $ $Date: 2002-11-13 17:44:33 $ + * last change: $Author: toconnor $ $Date: 2002-11-26 12:46:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,6 +69,8 @@ import org.openide.loaders.*; import org.openide.util.NbBundle; import org.openide.util.actions.SystemAction; +import org.openoffice.idesupport.OfficeDocument; + /** Recognizes single files in the Repository as being of a certain type. * * @author tomaso @@ -85,7 +87,7 @@ public class ParcelDescriptorDataLoader extends UniFileLoader { } protected String defaultDisplayName() { - return "StarOffice Script Parcel Descriptor"; + return OfficeDocument.OFFICE_PRODUCT_NAME + " Script Parcel Descriptor"; } protected void initialize() { diff --git a/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java b/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java index bb6855182411..95ef49aa7add 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java +++ b/scripting/java/org/openoffice/netbeans/modules/office/options/OfficeSettings.java @@ -2,9 +2,9 @@ * * $RCSfile: OfficeSettings.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: toconnor $ $Date: 2002-11-13 17:44:38 $ + * last change: $Author: toconnor $ $Date: 2002-11-26 12:46:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -114,7 +114,7 @@ public class OfficeSettings extends SystemOption { // if no office version is found try a default value setOfficeDirectory(System.getProperty("user.home") + - System.getProperty("file.separator") + "StarOffice6.0"); + System.getProperty("file.separator") + "OpenOffice643C"); } public String displayName() { diff --git a/scripting/java/org/openoffice/netbeans/modules/office/resources/Bundle.properties b/scripting/java/org/openoffice/netbeans/modules/office/resources/Bundle.properties index 8efe75cbba72..a0bafd579bf7 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/resources/Bundle.properties +++ b/scripting/java/org/openoffice/netbeans/modules/office/resources/Bundle.properties @@ -1,11 +1,11 @@ -Templates/StarOfficeScripting=StarOffice Scripting -Templates/StarOfficeScripting/parcel.xml=Script Parcel Descriptor +Templates/OfficeScripting=Office Scripting +Templates/OfficeScripting/parcel.xml=Script Parcel Descriptor Services/MIMEResolver/org-netbeans-modules-office-mime-resolver.xml=Script Parcel Descriptor File Templates=Templates -Templates/StarOfficeScripting/HelloWorld=Hello World Example Script +Templates/OfficeScripting/HelloWorld=Hello World Example Script Templates/Mount/org-openoffice-netbeans-modules-office-resources-AppStorage.settings=Office Application Scripts -Templates/Mount/org-openoffice-netbeans-modules-office-resources-OpenOfficeDocFileSystem.settings=OpenOffice document +Templates/Mount/org-openoffice-netbeans-modules-office-resources-OpenOfficeDocFileSystem.settings=OpenOffice.org document UI/Services/IDEConfiguration/ServerAndExternalToolSettings/org-openoffice-netbeans-modules-office-options-OfficeSettings.instance=Office Settings @@ -15,6 +15,6 @@ PROP_OfficeDirectory=Office Installation Directory HINT_OfficeDirectory=Path to directory where Office is installed -Templates/StarOfficeScripting/Parcel=Parcel Recipe +Templates/OfficeScripting/Parcel=Parcel Recipe Menu/Help/office-scripting.url=&Office Scripting Framework Site diff --git a/scripting/java/org/openoffice/netbeans/modules/office/resources/EmptyParcel.html b/scripting/java/org/openoffice/netbeans/modules/office/resources/EmptyParcel.html index 8fcf355581ba..f3c478c42aa3 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/resources/EmptyParcel.html +++ b/scripting/java/org/openoffice/netbeans/modules/office/resources/EmptyParcel.html @@ -6,6 +6,6 @@ </HEAD> <BODY> <P> -This allows you to create an Empty StarOffice Script. +This allows you to create an Empty Office Script. </BODY> </HTML> diff --git a/scripting/java/org/openoffice/netbeans/modules/office/resources/OpenOfficeDocFileSystem.html b/scripting/java/org/openoffice/netbeans/modules/office/resources/OpenOfficeDocFileSystem.html index 1b7d1af17885..5a879388bb28 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/resources/OpenOfficeDocFileSystem.html +++ b/scripting/java/org/openoffice/netbeans/modules/office/resources/OpenOfficeDocFileSystem.html @@ -6,6 +6,6 @@ </HEAD> <BODY> <P> -This allows you to mount OpenOffice document. +This allows you to mount OpenOffice.org document. </BODY> </HTML> diff --git a/scripting/java/org/openoffice/netbeans/modules/office/resources/ScriptParcel.html b/scripting/java/org/openoffice/netbeans/modules/office/resources/ScriptParcel.html index a35bbed554ba..c0f489032b9c 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/resources/ScriptParcel.html +++ b/scripting/java/org/openoffice/netbeans/modules/office/resources/ScriptParcel.html @@ -6,6 +6,6 @@ </HEAD> <BODY> <P> -This allows you to create a Hello World example StarOffice Script. +This allows you to create a Hello World example Office Script. </BODY> </HTML> diff --git a/scripting/java/org/openoffice/netbeans/modules/office/resources/ScriptParcelDescriptor.html b/scripting/java/org/openoffice/netbeans/modules/office/resources/ScriptParcelDescriptor.html index 3fee94d83bd1..d753d5dfe926 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/resources/ScriptParcelDescriptor.html +++ b/scripting/java/org/openoffice/netbeans/modules/office/resources/ScriptParcelDescriptor.html @@ -6,6 +6,6 @@ </HEAD> <BODY> <P> -This allows you to create a StarOffice Script Parcel Descriptor File. +This allows you to create a Office Script Parcel Descriptor File. </BODY> </HTML> diff --git a/scripting/java/org/openoffice/netbeans/modules/office/resources/layer.xml b/scripting/java/org/openoffice/netbeans/modules/office/resources/layer.xml index 7e8089f0c9a1..c713af66218a 100644 --- a/scripting/java/org/openoffice/netbeans/modules/office/resources/layer.xml +++ b/scripting/java/org/openoffice/netbeans/modules/office/resources/layer.xml @@ -3,7 +3,7 @@ <filesystem> <folder name="Templates"> <attr name="SystemFileSystem.localizingBundle" stringvalue="org.openoffice.netbeans.modules.office.resources.Bundle"/> - <folder name="StarOfficeScripting"> + <folder name="OfficeScripting"> <attr name="SystemFileSystem.localizingBundle" stringvalue="org.openoffice.netbeans.modules.office.resources.Bundle"/> <folder name="Parcel"> <attr boolvalue="true" name="template"/> @@ -17,8 +17,8 @@ </folder> </folder> </folder> - <attr boolvalue="true" name="Ant/StarOfficeScripting"/> - <attr boolvalue="true" name="StarOfficeScripting/Other"/> + <attr boolvalue="true" name="Ant/OfficeScripting"/> + <attr boolvalue="true" name="OfficeScripting/Other"/> <!-- OpenOfficeDoc FileSystem BEGIN: --> <!-- Uncomment to enable writable mounting of Office Documents |