Package jenkins.fingerprints
Class FileFingerprintStorage
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<FingerprintStorage>
-
- jenkins.fingerprints.FingerprintStorage
-
- jenkins.fingerprints.FileFingerprintStorage
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<FingerprintStorage>
@Symbol("fileFingerprintStorage") @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Extension(ordinal=-100.0) public class FileFingerprintStorage extends FingerprintStorage
Default file system storage implementation for fingerprints.- Author:
- Sumit Sarin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileFingerprintStorage.DescriptorImpl
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static String
FINGERPRINTS_DIR_NAME
-
Constructor Summary
Constructors Constructor Description FileFingerprintStorage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(String id)
Deletes the Fingerprint with the given unique ID.protected Fingerprint
getFingerprint(Fingerprint fp)
protected File
getRootDir()
boolean
isReady()
Returns true if there's some data in the local fingerprint database.void
iterateAndCleanupFingerprints(TaskListener taskListener)
Perform Fingerprint cleanup.static Fingerprint
load(File file)
Load the Fingerprint stored inside the given file.Fingerprint
load(String id)
Load the Fingerprint with the given unique id.protected Fingerprint
loadFingerprint(File fingerprintFile)
void
save(Fingerprint fp)
Saves the given Fingerprint in local XML-based database.static void
save(Fingerprint fp, File file)
Saves the given Fingerprint as XML inside file.-
Methods inherited from class jenkins.fingerprints.FingerprintStorage
cleanFingerprint, get, getDescriptor, getFileFingerprintStorage
-
-
-
-
Field Detail
-
FINGERPRINTS_DIR_NAME
public static final String FINGERPRINTS_DIR_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
load
@CheckForNull public Fingerprint load(@NonNull String id) throws IOException
Load the Fingerprint with the given unique id.- Specified by:
load
in classFingerprintStorage
- Throws:
IOException
- Load error
-
load
@CheckForNull public static Fingerprint load(@NonNull File file) throws IOException
Load the Fingerprint stored inside the given file.- Throws:
IOException
-
save
public void save(Fingerprint fp) throws IOException
Saves the given Fingerprint in local XML-based database.- Specified by:
save
in classFingerprintStorage
- Parameters:
fp
- Fingerprint file to be saved.- Throws:
IOException
- Save error
-
save
public static void save(Fingerprint fp, File file) throws IOException
Saves the given Fingerprint as XML inside file.- Throws:
IOException
-
delete
public void delete(String id) throws IOException
Deletes the Fingerprint with the given unique ID.- Specified by:
delete
in classFingerprintStorage
- Throws:
IOException
- Deletion error
-
isReady
public boolean isReady()
Returns true if there's some data in the local fingerprint database.- Specified by:
isReady
in classFingerprintStorage
-
iterateAndCleanupFingerprints
public void iterateAndCleanupFingerprints(TaskListener taskListener)
Perform Fingerprint cleanup.- Specified by:
iterateAndCleanupFingerprints
in classFingerprintStorage
-
loadFingerprint
protected Fingerprint loadFingerprint(File fingerprintFile) throws IOException
- Throws:
IOException
-
getFingerprint
protected Fingerprint getFingerprint(Fingerprint fp) throws IOException
- Overrides:
getFingerprint
in classFingerprintStorage
- Throws:
IOException
-
getRootDir
protected File getRootDir()
-
-