kfs.delete(res.getSourcePath()); kfs.write(ResourceFactory.newFileResource(packageFile));
private void removeResource(final Path resource) { kieFileSystem.delete(destinationPath(resource)); removeJavaClass(resource); }
public IncrementalBuildResults deleteResource( final Path resource ) { //Check a full build has been performed if ( !isBuilt() ) { throw new IllegalStateException( "A full build needs to be performed before any incremental operations." ); } //Delete resource final String destinationPath = resource.toUri().toString().substring( projectPrefix.length() + 1 ); kieFileSystem.delete( destinationPath ); //Incremental build final IncrementalResults incrementalResults = ( (InternalKieBuilder) kieBuilder ).createFileSet( destinationPath ).build(); //Messages from incremental build final IncrementalBuildResults results = convertMessages( incrementalResults ); //Tidy-up removed message handles for ( Message message : incrementalResults.getRemovedMessages() ) { handles.remove( RESOURCE_PATH + "/" + message.getPath() ); } return results; }
kfs.delete(res.getSourcePath()); kfs.write(ResourceFactory.newFileResource(packageFile));