Package org.ek9lang.core
Class FileHandling
java.lang.Object
org.ek9lang.core.FileHandling
Designed to abstract out all file handling for the compiler.
-
Constructor Summary
ConstructorDescriptionFileHandling
(OsSupport osSupport) Create File Handling with the appropriately configured OS support. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanEk9DirectoryStructureFor
(File ek9File, String targetArchitecture) void
cleanEk9DirectoryStructureFor
(String ek9FullPathToFileName, String targetArchitecture) boolean
Copy a file to a new destination.boolean
Copy a named file from a source directory to a destination directory.boolean
Create a Java jar file with a list of zip sets.createSha256Of
(String fileName) Create a sha256 hash of a file and save it in fileName".sha256"boolean
To be used for making the zip when publishing ek9 source to artefact server.void
deleteContentsAndBelow
(File dir, boolean includeDirectoryRoot) Does a recursive delete from this directory and below.void
deleteFileIfExists
(File file) Deletes a file if it exists or a compiler exception if it cannot be deleted.void
deleteMatchingFiles
(File dir, String fileNamePattern) deletes matching files.void
deleteStalePackages
(String ek9FileNameDirectory, String moduleName) getDevFinalOutputDirectory
(String fromEk9BaseDirectory, String targetArchitecture) getDevGeneratedOutputDirectory
(String fromEk9BaseDirectory, String targetArchitecture) getDotEk9Directory
(File directory) getDotEk9Directory
(String fromDirectory) getMainFinalOutputDirectory
(String fromEk9BaseDirectory, String targetArchitecture) getMainGeneratedOutputDirectory
(String fromEk9BaseDirectory, String targetArchitecture) getTargetExecutableArtefact
(String ek9FullPathToFileName, String targetArchitecture) getTargetPropertiesArtefact
(String ek9FullPathToFileName) boolean
makeDependencyVector
(String moduleName, String version) Create a full dependency vector out of module name and verssion.void
makeDirectoryIfNotExists
(File directory) Create a directory.makePackagedModuleZipFileName
(String dependencyVector) makePackagedModuleZipFileName
(String moduleName, String version) boolean
saveToHomeEk9Directory
(SigningKeyPair keyPair) boolean
saveToOutput
(File file, String value) Save some text to a file.boolean
unZipFileTo
(File zipFile, File unpackedDir) Unzips a zip file into a directory, the directory will be created if it does not exist.boolean
unZipFileTo
(File zipFile, String unpackedDir) void
validateEk9Directory
(String directoryName, String targetArchitecture) void
validateHomeEk9Directory
(String targetArchitecture)
-
Constructor Details
-
FileHandling
Create File Handling with the appropriately configured OS support. Quite a few of these methods just delegate to OsSupport and the Packager.
-
-
Method Details
-
getTempDirectory
-
getUsersHomeDirectory
-
getUsersHomeEk9LibDirectory
-
getUsersHomeEk9Directory
-
getDotEk9Directory
-
getDotEk9Directory
-
makePackagedModuleZipFileName
-
makePackagedModuleZipFileName
-
makeDependencyVector
Create a full dependency vector out of module name and verssion. -
copy
Copy a named file from a source directory to a destination directory. -
copy
Copy a file to a new destination. -
saveToOutput
Save some text to a file. -
deleteFileIfExists
Deletes a file if it exists or a compiler exception if it cannot be deleted. -
makeDirectoryIfNotExists
Create a directory. -
deleteMatchingFiles
deletes matching files.- Parameters:
dir
- the directory to look infileNamePattern
- The pattern regex not shell so for * use .* for .txt use \\.txt
-
deleteContentsAndBelow
Does a recursive delete from this directory and below. If includeDirectoryRoot is true then it will delete that directory as well -
createSha256Of
Create a sha256 hash of a file and save it in fileName".sha256" -
createJar
Create a Java jar file with a list of zip sets. -
unZipFileTo
-
unZipFileTo
Unzips a zip file into a directory, the directory will be created if it does not exist. -
createZip
To be used for making the zip when publishing ek9 source to artefact server.- Parameters:
fileName
- The name of the zip to createsourcePropertiesFile
- The properties file that describes the package.- Returns:
- true if all OK.
-
getTargetExecutableArtefact
-
getTargetPropertiesArtefact
-
validateHomeEk9Directory
-
validateEk9Directory
-
cleanEk9DirectoryStructureFor
-
cleanEk9DirectoryStructureFor
-
getMainGeneratedOutputDirectory
-
getMainFinalOutputDirectory
-
getDevGeneratedOutputDirectory
-
getDevFinalOutputDirectory
-
deleteStalePackages
-
isUsersSigningKeyPairPresent
public boolean isUsersSigningKeyPairPresent() -
getUsersSigningKeyPair
-
saveToHomeEk9Directory
-