check if removing the file is ok with the rules for the Resource interface, to not change this
rules.

@param resource
@throws IOException
482538
public static void checkRemoveOK(Resource resource) throws IOException {
	if (!resource.exists()) throw new IOException("can't delete resource " + resource + ", resource does not exist");
	if (!resource.canWrite()) throw new IOException("can't delete resource " + resource + ", no access");

    }
450750
public static boolean isFile(Resource resource) {
        return resource.isResourceType(ResourceUtil.TYPE_FILE) ||
                resource.isResourceType(ResourceUtil.TYPE_LINKED_FILE);
    }
349312
public static void deleteFile(@Nullable Path path) throws IOException {
		Validate.isTrue(isFileExists(path), "%s is not exist or not a file", path);

		Files.delete(path);
	}
1070085
protected void deleteResource(I_CmsIndexWriter indexWriter, CmsPublishedResource resource) {

        try {
            if (LOG.isInfoEnabled()) {
                LOG.info(Messages.get().getBundle().key(Messages.LOG_DELETING_FROM_INDEX_1, resource.getRootPath()));
            }
            // delete all documents with this term from the index
            indexWriter.deleteDocument(resource);
        } catch (IOException e) {
            if (LOG.isWarnEnabled()) {
                LOG.warn(
                    Messages.get().getBundle().key(
                        Messages.LOG_IO_INDEX_DOCUMENT_DELETE_2,
                        resource.getRootPath(),
                        m_index.getName()),
                    e);
            }
        }
    }
491252
public boolean isAvailable (String resource){
	    
	    Container c = _webapp.getModuleContainer();
	    if(c != null){
	       Entry entry = c.getEntry(resource); 
	       if(entry != null){
	           return true;
	       }
	       return isAvailableInDocumentRoot(resource,WCCustomProperties.SERVE_WELCOME_FILE_FROM_EDR);
	    }
	    
	    String tempFileString = _webapp.getRealPath(resource);
	    boolean available = false;
	    if (tempFileString != null) { 
	        File caseFile = new Java2SecurityFile(tempFileString);
		available = caseFile.exists();
		if (available && com.ibm.ws.util.FileSystem.isCaseInsensitive) {
			try{
				available = com.ibm.ws.util.FileSystem.uriCaseCheck(caseFile, resource);
			}catch (IOException io){
				available = false;
			}
		}
        }
		
	    if (!available)
	    	available = isAvailableInDocumentRoot(resource,WCCustomProperties.SERVE_WELCOME_FILE_FROM_EDR);			
		
        return available;
	}
234339
public static base_response clear(nitro_service client, Interface resource) throws Exception {
		Interface clearresource = new Interface();
		clearresource.id = resource.id;
		return clearresource.perform_operation(client,"clear");
	}
1274277
public static void deleteFile(@Nonnull File f) throws IOException {
        newPathRemover(PathRemover.PathChecker.ALLOW_ALL).forceRemoveFile(fileToPath(f));
    }
1199064
public static boolean isFolder(String resource) {

        return CmsStringUtil.isNotEmpty(resource) && (resource.charAt(resource.length() - 1) == '/');
    }
916893
static void createFileFromResource(String resource, Resource file) throws IOException {
	createFileFromResource(resource, file, null);
    }
1348889
public void deleteFile(String name) throws IOException {
    if (!fs.delete(new Path(directory, name))) {
      throw new IOException("Cannot delete index file " + name);
    }
  }
24232
public static void checkMoveToOK(Resource source, Resource target) throws IOException {
	if (!source.exists()) {
	    throw new IOException("can't move [" + source.getPath() + "] to [" + target.getPath() + "], source file does not exist");
	}
	if (source.isDirectory() && target.isFile()) throw new IOException("can't move [" + source.getPath() + "] directory to [" + target.getPath() + "], target is a file");
	if (source.isFile() && target.isDirectory()) throw new IOException("can't move [" + source.getPath() + "] file to [" + target.getPath() + "], target is a directory");
    }
1249039
protected synchronized void unjoin(SIXAResource resource)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unjoin", resource);
      resourcesJoinedToThisResource.remove(resource);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "unjoin");
   }
433857
@Override
  public void close() throws IOException {

    if (Files.exists(outFile)) {
      Files.delete(outFile);
    }

    if (Files.exists(errFile)) {
      Files.delete(errFile);
    }

    if (Files.exists(resultFile)) {
      Files.delete(resultFile);
    }
  }
365623
@PUT
    public Response conditionalUpdate(final String resource)
            throws IOException {
        return execute(getResourceRequest(RequestTypeEnum.PUT, RestOperationTypeEnum.UPDATE).resource(resource));
    }
813148
public static void copyResource(String resource, File destination) throws IOException {
        InputStream is = null;
        FileOutputStream fos = null;

        try {
            is = FileUtils.class.getResourceAsStream("/" + resource);
            fos = new FileOutputStream(destination);

            final byte[] buffer = new byte[10 * 1024];
            int len;
            while ((len = is.read(buffer)) > 0) {
                fos.write(buffer, 0, len);
            }
        } finally {
            close(is);
            close(fos);
        }

    }
996640
public static void ensureValidResource(JsonNode resource) {
		if (!resource.has(JSONAPISpecConstants.DATA) && !resource.has(JSONAPISpecConstants.META)) {
			throw new InvalidJsonApiResourceException();
		}
	}
566325
public function removeResource(AbstractResourceFile $resource) {
        if (parent::offsetExists($resource->getMemberId())) {
            parent::offsetUnset($resource->getMemberId());
        }
    }