Class MemoryFileSystem
- java.lang.Object
-
- org.drools.compiler.compiler.io.memory.MemoryFileSystem
-
- All Implemented Interfaces:
Serializable,FileSystem,org.kie.memorycompiler.resources.ResourceReader,org.kie.memorycompiler.resources.ResourceStore
public class MemoryFileSystem extends Object implements FileSystem, org.kie.memorycompiler.resources.ResourceReader, Serializable, org.kie.memorycompiler.resources.ResourceStore
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MemoryFileSystem()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MemoryFileSystemclone()intcopyFolder(Folder srcFolder, MemoryFileSystem trgMfs, Folder trgFolder, String... filters)voidcreateFolder(MemoryFolder folder)booleanequals(Object obj)booleanexistsFile(org.kie.memorycompiler.resources.KiePath path)booleanexistsFolder(MemoryFolder folder)booleanexistsFolder(org.kie.memorycompiler.resources.KiePath path)StringfindPomProperties()byte[]getBytes(org.kie.memorycompiler.resources.KiePath resourcePath)FilegetFile(org.kie.memorycompiler.resources.KiePath path)byte[]getFileContents(MemoryFile file)Collection<org.kie.memorycompiler.resources.KiePath>getFilePaths()FoldergetFolder(org.kie.memorycompiler.resources.KiePath path)Map<org.kie.memorycompiler.resources.KiePath,byte[]>getMap()Set<? extends FileSystemItem>getMembers(Folder folder)Collection<String>getModifiedResourcesSinceLastMark()org.drools.core.io.internal.InternalResourcegetResource(MemoryFile file)org.drools.core.io.internal.InternalResourcegetResource(org.kie.memorycompiler.resources.KiePath resourcePath)FoldergetRootFolder()inthashCode()booleanisAvailable(org.kie.memorycompiler.resources.KiePath resourcePath)voidmark()ClassLoadermemoryClassLoader(ClassLoader parent)voidprintFs(PrintStream out)voidprintFs(Folder f, PrintStream out)byte[]read(org.kie.memorycompiler.resources.KiePath resourcePath)static MemoryFileSystemreadFromJar(byte[] jarFile)static MemoryFileSystemreadFromJar(File jarFile)static MemoryFileSystemreadFromJar(InputStream jarFile)voidremove(Set<FileSystemItem> members)booleanremove(File file)booleanremove(Folder folder)voidremove(org.kie.memorycompiler.resources.KiePath resourcePath)voidsetFileContents(MemoryFile file, byte[] contents)voidsetFileContents(MemoryFile file, org.kie.api.io.Resource resource)StringtoString()voidwrite(org.kie.memorycompiler.resources.KiePath resourcePath, byte[] pResourceData)voidwrite(org.kie.memorycompiler.resources.KiePath resourcePath, byte[] pResourceData, boolean createFolder)voidwrite(org.kie.memorycompiler.resources.KiePath resourcePath, org.kie.api.io.Resource resource)voidwrite(org.kie.memorycompiler.resources.KiePath resourcePath, org.kie.api.io.Resource resource, boolean createFolder)byte[]writeAsBytes()voidwriteAsFs(File file)voidwriteAsFs(Folder f, File file1)FilewriteAsJar(File folder, String jarName)-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.compiler.compiler.io.FileSystem
getFile, getFolder
-
-
-
-
Method Detail
-
getRootFolder
public Folder getRootFolder()
- Specified by:
getRootFolderin interfaceFileSystem
-
getFilePaths
public Collection<org.kie.memorycompiler.resources.KiePath> getFilePaths()
- Specified by:
getFilePathsin interfaceorg.kie.memorycompiler.resources.ResourceReader
-
getMap
public Map<org.kie.memorycompiler.resources.KiePath,byte[]> getMap()
-
getFile
public File getFile(org.kie.memorycompiler.resources.KiePath path)
- Specified by:
getFilein interfaceFileSystem
-
getFolder
public Folder getFolder(org.kie.memorycompiler.resources.KiePath path)
- Specified by:
getFolderin interfaceFileSystem
-
getMembers
public Set<? extends FileSystemItem> getMembers(Folder folder)
-
getFileContents
public byte[] getFileContents(MemoryFile file)
-
getResource
public org.drools.core.io.internal.InternalResource getResource(MemoryFile file)
-
setFileContents
public void setFileContents(MemoryFile file, byte[] contents) throws IOException
- Throws:
IOException
-
setFileContents
public void setFileContents(MemoryFile file, org.kie.api.io.Resource resource) throws IOException
- Throws:
IOException
-
mark
public void mark()
- Specified by:
markin interfaceorg.kie.memorycompiler.resources.ResourceReader
-
getModifiedResourcesSinceLastMark
public Collection<String> getModifiedResourcesSinceLastMark()
- Specified by:
getModifiedResourcesSinceLastMarkin interfaceorg.kie.memorycompiler.resources.ResourceReader
-
existsFolder
public boolean existsFolder(MemoryFolder folder)
-
existsFolder
public boolean existsFolder(org.kie.memorycompiler.resources.KiePath path)
-
existsFile
public boolean existsFile(org.kie.memorycompiler.resources.KiePath path)
-
createFolder
public void createFolder(MemoryFolder folder)
-
remove
public boolean remove(Folder folder)
- Specified by:
removein interfaceFileSystem
-
remove
public void remove(Set<FileSystemItem> members)
-
remove
public boolean remove(File file)
- Specified by:
removein interfaceFileSystem
-
copyFolder
public int copyFolder(Folder srcFolder, MemoryFileSystem trgMfs, Folder trgFolder, String... filters)
-
printFs
public void printFs(PrintStream out)
-
printFs
public void printFs(Folder f, PrintStream out)
-
isAvailable
public boolean isAvailable(org.kie.memorycompiler.resources.KiePath resourcePath)
- Specified by:
isAvailablein interfaceorg.kie.memorycompiler.resources.ResourceReader
-
getBytes
public byte[] getBytes(org.kie.memorycompiler.resources.KiePath resourcePath)
- Specified by:
getBytesin interfaceorg.kie.memorycompiler.resources.ResourceReader
-
getResource
public org.drools.core.io.internal.InternalResource getResource(org.kie.memorycompiler.resources.KiePath resourcePath)
-
write
public void write(org.kie.memorycompiler.resources.KiePath resourcePath, byte[] pResourceData)- Specified by:
writein interfaceorg.kie.memorycompiler.resources.ResourceStore
-
write
public void write(org.kie.memorycompiler.resources.KiePath resourcePath, byte[] pResourceData, boolean createFolder)- Specified by:
writein interfaceorg.kie.memorycompiler.resources.ResourceStore
-
write
public void write(org.kie.memorycompiler.resources.KiePath resourcePath, org.kie.api.io.Resource resource)
-
write
public void write(org.kie.memorycompiler.resources.KiePath resourcePath, org.kie.api.io.Resource resource, boolean createFolder)
-
read
public byte[] read(org.kie.memorycompiler.resources.KiePath resourcePath)
- Specified by:
readin interfaceorg.kie.memorycompiler.resources.ResourceStore
-
remove
public void remove(org.kie.memorycompiler.resources.KiePath resourcePath)
- Specified by:
removein interfaceorg.kie.memorycompiler.resources.ResourceStore
-
writeAsBytes
public byte[] writeAsBytes()
-
writeAsFs
public void writeAsFs(File file)
-
readFromJar
public static MemoryFileSystem readFromJar(File jarFile)
-
readFromJar
public static MemoryFileSystem readFromJar(byte[] jarFile)
-
readFromJar
public static MemoryFileSystem readFromJar(InputStream jarFile)
-
findPomProperties
public String findPomProperties()
-
clone
public MemoryFileSystem clone()
-
memoryClassLoader
public ClassLoader memoryClassLoader(ClassLoader parent)
-
-