public class ModelFragmentRessourceUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
extension |
private static java.lang.String |
metaFileName |
private static java.lang.String |
xmiFileName |
Constructor and Description |
---|
ModelFragmentRessourceUtils() |
Modifier and Type | Method and Description |
---|---|
private static void |
copy(java.io.InputStream in,
java.io.OutputStream out) |
private static void |
copyFile(java.io.File source,
java.io.File target)
This service copies a file content into another file.
|
private static void |
createDirectory(java.io.File directory) |
private static ModelFragment |
createSchema(ModelFragmentRessource ressource) |
static java.lang.String |
getArchiveExtension() |
static byte[] |
getArrayByteFromFile(java.io.File f) |
static java.io.File |
getFileFromArrayByte(byte[] content,
java.lang.String filePath) |
static java.lang.String |
getMetadatasFileName() |
static java.lang.String |
geXmiFileName() |
static void |
loadFiles(ModelFragmentRessource data,
java.io.File outputDir) |
static java.io.File |
packageFragment(ModelFragmentRessource fragment,
java.io.File fileRoot)
This method handles the packaging of a giving ModelFragment and its resources (xmifile, resourceFiles, propertyFiles).
|
static void |
unpackageFragment(java.io.File archive,
java.io.File outputDir)
This method handles the unpackaging of the given archive inside the given ouputDir
and return the corresponding Model Fragment
|
private static void |
unzipEntry(java.util.zip.ZipFile zipfile,
java.util.zip.ZipEntry entry,
java.io.File outputDir) |
private static final java.lang.String extension
private static final java.lang.String metaFileName
private static final java.lang.String xmiFileName
public static void loadFiles(ModelFragmentRessource data, java.io.File outputDir)
public static java.io.File packageFragment(ModelFragmentRessource fragment, java.io.File fileRoot)
fragment
- : the ModelFragment to packagefileRoot
- : the folder which will contain the created archive and containing all the resources (xmifile, resourceFiles, propertyFiles)private static ModelFragment createSchema(ModelFragmentRessource ressource)
private static void copyFile(java.io.File source, java.io.File target)
source
- The source filetarget
- The target filepublic static void unpackageFragment(java.io.File archive, java.io.File outputDir) throws java.io.IOException, java.util.zip.ZipException
archive
- : the archive to unpackageoutputDir
- : the root folder of the unpackaging resultjava.util.zip.ZipException
- ZipExceptionjava.io.IOException
- IOExceptionpublic static java.lang.String getMetadatasFileName()
public static java.lang.String geXmiFileName()
public static java.lang.String getArchiveExtension()
private static void unzipEntry(java.util.zip.ZipFile zipfile, java.util.zip.ZipEntry entry, java.io.File outputDir) throws java.io.IOException
java.io.IOException
private static void createDirectory(java.io.File directory)
private static void copy(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public static byte[] getArrayByteFromFile(java.io.File f) throws java.io.IOException
java.io.IOException
public static java.io.File getFileFromArrayByte(byte[] content, java.lang.String filePath) throws java.io.IOException
java.io.IOException