Package gov.nih.mipav.plugins
Class ManifestFile
java.lang.Object
gov.nih.mipav.plugins.ManifestFile
Stores the default manifest file as a static reference, or optionally can be used for creating custom manifest files.
A local and system copy of the manifest file are stored. By storing manifest entries as class files, this should remove
any classpath problems occurring for plugins using the install/uninstall feature.
- Author:
- senseneyj
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringStandard delimiter after manifest file.private static final StringSignifies manifest file lists a dependent after delimiter.private static final StringSystem-dependent line delimiter.private Filestatic final StringThe manifest file as a set of class files.private static final StringSignifies manifest file lists a plugin after delimiter.private static ManifestFileprivate long -
Constructor Summary
ConstructorsConstructorDescriptionGets/creates manifest file in default location.ManifestFile(String alternateLoc) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an entry to the manifest file, does in fact write to the file.private voidprivate voidGets the dependents of class c.static ManifestFileGets the default manifest, guaranteed to be latest default version unless working in threaded environment.private voidinit()modifyEntry(Class c, Class... dependents) Inserts all the dependents that are not currently a dependent into c's entry into the manifest.voidrefresh()Rereads the manifest to load any changes, whether or not any changes have been made.removeEntry(Class c) Removes class c and its dependents from the manifest, does in fact write to the file.private voidHelper method for removing c from the manifest file on the file system.private voidwriteTmpToManifest(File temp)
-
Field Details
-
MANIFEST_LOC
-
PLUGIN_ENTRY
Signifies manifest file lists a plugin after delimiter.- See Also:
-
DEPENDENT_ENTRY
Signifies manifest file lists a dependent after delimiter.- See Also:
-
DELIMITER
Standard delimiter after manifest file.- See Also:
-
LINE_DELIM
System-dependent line delimiter. -
manifest
-
timeLoaded
private long timeLoaded -
staticRef
-
manifestInfo
The manifest file as a set of class files.
-
-
Constructor Details
-
ManifestFile
public ManifestFile()Gets/creates manifest file in default location. -
ManifestFile
- Parameters:
alternateLoc- where the manifest file is/should be created
-
-
Method Details
-
getReference
Gets the default manifest, guaranteed to be latest default version unless working in threaded environment. -
refresh
public void refresh()Rereads the manifest to load any changes, whether or not any changes have been made. -
init
private void init() -
parseManifestInfo
-
addEntry
Adds an entry to the manifest file, does in fact write to the file. If the entry errantly exists, this method modifies the entry.- Parameters:
c- the plugin classdependents- the classes that a given plugin uses
-
addToFile
-
getEntry
Gets the dependents of class c. Does not write to the file. If c does not appear to be in the manifest, refreshes. Returns null if c cannot be found.- Parameters:
c- the plugin class- Returns:
- the classes that a given plugin uses
-
removeEntry
Removes class c and its dependents from the manifest, does in fact write to the file. If c does not appear to be a plugin in the manifest, refreshes and returns null if not found. Returns all dependents that are not currently used by another entry in the manifest (either as a plugin or one of a plugin's dependents).- Parameters:
c-- Returns:
-
removeFromFile
Helper method for removing c from the manifest file on the file system.- Parameters:
c- the class to be removed.
-
writeTmpToManifest
-
modifyEntry
Inserts all the dependents that are not currently a dependent into c's entry into the manifest. If entry c doesn't appear to exist in the manifest, reloads the manifest and performs an addEntry if necessary.- Parameters:
c-dependents-- Returns:
- The full entry for c
- See Also:
-
createManifestFile
private void createManifestFile()
-