List extenalFiles = new ArrayList(emfResources.size());
List externalFiles = new ArrayList(emfResources.size());
    public static String validate(List emfResources)    {      org.eclipse.core.resources.IWorkspace workspace = org.eclipse.core.resources.ResourcesPlugin.getWorkspace();      org.eclipse.core.resources.IWorkspaceRoot workspaceRoot= workspace.getRoot();            List workspaceFiles = new ArrayList(emfResources.size());      List extenalFiles = new ArrayList(emfResources.size());      for (Iterator i = emfResources.iterator(); i.hasNext();)      {        Resource resource = (Resource)i.next();        URI uri = resource.getURI().trimFragment();        if (uri.isFile())        {          File file = new File(uri.toFileString());          if (file.isFile() && !file.canWrite())          {            extenalFiles.add(file);          }                }        else if (uri.isPlatformResource())        {          String path = uri.toPlatformString(true);          org.eclipse.core.resources.IResource workspaceResource = workspaceRoot.findMember(new org.eclipse.core.runtime.Path(path));          if (workspaceResource != null && workspaceResource.getType() == org.eclipse.core.resources.IResource.FILE && workspaceResource.getResourceAttributes().isReadOnly())          {            workspaceFiles.add(workspaceResource);          }        }      }            StringBuffer readOnlyFiles = new StringBuffer();      if (!workspaceFiles.isEmpty())      {        Object context = null;        if (org.eclipse.core.runtime.Platform.getBundle("org.eclipse.swt") != null)        {          context = ShellFinder.getActiveShell();        }                org.eclipse.core.resources.IFile[] files = (org.eclipse.core.resources.IFile[])workspaceFiles.toArray(new org.eclipse.core.resources.IFile [workspaceFiles.size()]);        if (!workspace.validateEdit(files, context).isOK())        {          for (int i = 0; i < files.length; i++)          {            if (files[i].isReadOnly())            {              readOnlyFiles.append(", ").append(files[i].getFullPath().toString());            }          }        }      }      if (!extenalFiles.isEmpty())      {        for (Iterator i = extenalFiles.iterator(); i.hasNext();)        {          File file = (File)i.next();          readOnlyFiles.append(", ").append(file.getAbsolutePath());        }      }            return readOnlyFiles.length() == 0 ?         null :         readOnlyFiles.deleteCharAt(0).deleteCharAt(0).toString();    }    