[204197] Make ModuleFile/Folder API
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFile.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFile.java
index bdc43cb..8d6c816 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFile.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFile.java
@@ -34,12 +34,13 @@
* @param path the path to the file
*/
public ModuleFile(IFile file, String name, IPath path) {
- if (file == null || name == null || path == null)
+ if (name == null)
throw new IllegalArgumentException();
this.file = file;
this.name = name;
this.path = path;
- stamp = file.getModificationStamp() + file.getLocalTimeStamp();
+ if (file != null)
+ stamp = file.getModificationStamp() + file.getLocalTimeStamp();
}
/**
@@ -50,12 +51,13 @@
* @param path
*/
public ModuleFile(File file, String name, IPath path) {
- if (file == null || name == null || path == null)
+ if (name == null)
throw new IllegalArgumentException();
this.file2 = file;
this.name = name;
this.path = path;
- stamp = file2.lastModified();
+ if (file2 != null)
+ stamp = file2.lastModified();
}
/**
@@ -67,7 +69,7 @@
* @param stamp
*/
public ModuleFile(String name, IPath path, long stamp) {
- if (name == null || path == null)
+ if (name == null)
throw new IllegalArgumentException();
this.name = name;
this.path = path;
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFolder.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFolder.java
index 38ca830..277dcee 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFolder.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ModuleFolder.java
@@ -35,7 +35,7 @@
* @param path the module relative path to the folder
*/
public ModuleFolder(IContainer container, String name, IPath path) {
- if (name == null || path == null)
+ if (name == null)
throw new IllegalArgumentException();
this.container = container;
this.name = name;
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java
index 68cd722..306764b 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java
@@ -14,10 +14,14 @@
import java.util.List;
import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.model.*;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
/**
* A simple IModuleProject that maps a folder within a project
* (or the root of the project itself) to the module.
@@ -163,7 +167,7 @@
String name = resource.getName();
if (resource instanceof IContainer) {
IContainer container2 = (IContainer) resource;
- ModuleFolder mf = new ModuleFolder(container2, name, path);
+ ModuleFolder mf = new org.eclipse.wst.server.core.internal.ModuleFolder(container2, name, path);
mf.setMembers(getModuleResources(path.append(name), container2));
list.add(mf);
} else if (resource instanceof IFile) {