Merge branch 'master' of git://git.eclipse.org/gitroot/libra/org.eclipse.libra.git
diff --git a/plugins/org.eclipse.libra.warproducts.core/src/org/eclipse/libra/warproducts/core/WARProductExportOperation.java b/plugins/org.eclipse.libra.warproducts.core/src/org/eclipse/libra/warproducts/core/WARProductExportOperation.java
index d168014..60b50ec 100644
--- a/plugins/org.eclipse.libra.warproducts.core/src/org/eclipse/libra/warproducts/core/WARProductExportOperation.java
+++ b/plugins/org.eclipse.libra.warproducts.core/src/org/eclipse/libra/warproducts/core/WARProductExportOperation.java
@@ -40,7 +40,7 @@
private String featureLocation;
private String root;
private IProduct product;
- protected static String errorMessage;
+ private static String errorMessage;
public static void setErrorMessage( final String message ) {
errorMessage = message;
@@ -204,7 +204,9 @@
{
File file = new File( featureLocation );
if( !file.exists() || !file.isDirectory() ) {
- file.mkdirs();
+ if (! file.mkdirs()){
+ throw new IOException( Messages.creatorCouldntCopy+"\n"+file );
+ }
}
Properties properties = new Properties();
handleRootFiles( configurations, properties );
@@ -249,10 +251,12 @@
}
}
- private String createLibDir() {
+ private String createLibDir() throws IOException {
String location = featureLocation;
File dir = new File( location, "lib" ); //$NON-NLS-1$
- dir.mkdirs();
+ if (! dir.mkdirs()){
+ throw new IOException( Messages.creatorCouldntCopy+": "+dir );
+ }
return dir.getAbsolutePath();
}
@@ -435,12 +439,13 @@
if( file.exists() ) {
BufferedReader reader = new BufferedReader(new FileReader(file));
String line = "";
- String oldtext = "";
+ StringBuilder oldtext = new StringBuilder();
while( ( line = reader.readLine() ) != null ) {
- oldtext += line + "\n";
+ oldtext.append( line );
+ oldtext.append( "\n" );
}
reader.close();
- String newtext = oldtext.replaceAll( "org.eclipse.equinox.http.servlet@start",
+ String newtext = oldtext.toString().replaceAll( "org.eclipse.equinox.http.servlet@start",
"org.eclipse.equinox.servletbridge.extensionbundle,\\\\\n " +
"org.eclipse.equinox.http.servlet@start");
FileWriter writer = new FileWriter( configIni );
diff --git a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/Messages.java b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/Messages.java
index f42170e..e362369 100644
--- a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/Messages.java
+++ b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/Messages.java
@@ -52,6 +52,8 @@
public static String NewWARProductError;
public static String LoadWARProductError;
public static String OutlinePluginsTitle;
+ public static String NewWARDeleteFailed_title;
+ public static String NewWARDeleteFailed_desc;
static {
// initialize resource bundle
NLS.initializeMessages( BUNDLE_NAME, Messages.class );
diff --git a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/LibrarySection.java b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/LibrarySection.java
index e1d52e6..74ab8da 100644
--- a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/LibrarySection.java
+++ b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/LibrarySection.java
@@ -59,7 +59,7 @@
}
- class LibraryLabelProvider extends LabelProvider {
+ static class LibraryLabelProvider extends LabelProvider {
public String getText( final Object element ) {
String result = ""; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WARProductInputContext.java b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WARProductInputContext.java
index 494c8a6..9199b1a 100644
--- a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WARProductInputContext.java
+++ b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WARProductInputContext.java
@@ -53,7 +53,7 @@
IFile file = ( ( IFileEditorInput )input ).getFile();
model = new WARWorkspaceProductModel( file, true );
model.load();
- } else if( input instanceof IStorageEditorInput ) {
+ } else {
IStorageEditorInput storageInput = ( IStorageEditorInput )input;
InputStream contents = storageInput.getStorage().getContents();
InputStream is = new BufferedInputStream( contents );
diff --git a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WARProductOutlinePage.java b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WARProductOutlinePage.java
index 8b8f978..86f3a18 100644
--- a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WARProductOutlinePage.java
+++ b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WARProductOutlinePage.java
@@ -78,7 +78,7 @@
return result;
}
- private class LibraryComparator implements Comparator {
+ private static class LibraryComparator implements Comparator {
public int compare( final Object o1,
final Object o2 ) {
diff --git a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WebXMLSourcePage.java b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WebXMLSourcePage.java
index d3582e9..7e766e9 100644
--- a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WebXMLSourcePage.java
+++ b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/editor/WebXMLSourcePage.java
@@ -82,7 +82,7 @@
return result;
}
}
- private class WebXmlContentProvider implements ITreeContentProvider
+ private static class WebXmlContentProvider implements ITreeContentProvider
{
public Object[] getElements( final Object inputElement ) {
diff --git a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/exportwizard/ExportWARProductWizard.java b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/exportwizard/ExportWARProductWizard.java
index 1de8093..9398336 100644
--- a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/exportwizard/ExportWARProductWizard.java
+++ b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/exportwizard/ExportWARProductWizard.java
@@ -134,7 +134,12 @@
if( !openQuestion ) {
result = false;
} else {
- zipFile.delete();
+ if (! zipFile.delete()){
+ MessageDialog.openError( getContainer().getShell(),
+ Messages.NewWARDeleteFailed_title,
+ Messages.NewWARDeleteFailed_desc+"\n"+zipFile);
+ result = false;
+ }
}
}
}
diff --git a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/exportwizard/SelectionPage.java b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/exportwizard/SelectionPage.java
index 83d2712..ffa8dcd 100644
--- a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/exportwizard/SelectionPage.java
+++ b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/exportwizard/SelectionPage.java
@@ -73,7 +73,7 @@
if( firstElement != null && firstElement instanceof IFile ) {
IFile file = ( IFile )firstElement;
String fileExtension = file.getFileExtension();
- if( fileExtension.equals( WARProductConstants.FILE_EXTENSION ) ) {
+ if( WARProductConstants.FILE_EXTENSION.equals( fileExtension ) ) {
warProductFile = file;
wizard.loadProductFromFile( file );
}
diff --git a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/messages.properties b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/messages.properties
index 5dad8cc..b09df52 100644
--- a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/messages.properties
+++ b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/messages.properties
@@ -35,3 +35,5 @@
NewWARProductError=Error while initializing WAR Product
LoadWARProductError=Error while loading WAR Product
OutlinePluginsTitle=Plug-Ins
+NewWARDeleteFailed_title=WAR File Export could not complete
+NewWARDeleteFailed_desc=Existing file at export destination could not be deleted.
diff --git a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/validation/PluginStatusDialog.java b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/validation/PluginStatusDialog.java
index e0e2989..6f5dd7f 100644
--- a/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/validation/PluginStatusDialog.java
+++ b/plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/validation/PluginStatusDialog.java
@@ -22,7 +22,6 @@
public class PluginStatusDialog extends TrayDialog {
- public Map input;
private PluginStatusContentVisualizer viewer;
public PluginStatusDialog( final Shell parentShell ) {
@@ -32,7 +31,6 @@
}
public void setInput( final Map input ) {
- this.input = input;
viewer.setInput( input );
}
@@ -87,7 +85,6 @@
}
public void refresh( final Map input ) {
- this.input = input;
viewer.getViewer().setInput( input );
viewer.getViewer().refresh();
}