Update all instances of OpenOffice and StarOffice to OpenOffice.org.

Ensure that ZipFile instances are closed.
This commit is contained in:
Tomas O'Connor
2002-11-26 11:46:48 +00:00
parent 5d8c40bc2e
commit 18e78c160c
15 changed files with 85 additions and 53 deletions

View File

@@ -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();
}

View File

@@ -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;
}

View File

@@ -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.

View File

@@ -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>
*/

View File

@@ -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>
*/

View File

@@ -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);

View File

@@ -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:

View File

@@ -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() {

View File

@@ -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() {

View File

@@ -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

View File

@@ -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>

View File

@@ -6,6 +6,6 @@
</HEAD>
<BODY>
<P>
This allows you to mount OpenOffice document.
This allows you to mount OpenOffice.org document.
</BODY>
</HTML>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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