Package hudson.util
Class SecretRewriter
- java.lang.Object
-
- hudson.util.SecretRewriter
-
public class SecretRewriter extends Object
Rewrites XML files by looking for Secrets that are stored with the old key and replaces them by the new encrypted values.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description SecretRewriter()SecretRewriter(File backupDirectory)Deprecated.SECURITY-376:backupDirectoryis ignored
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected booleanisIgnoredDir(File dir)Decides if this directory is worth visiting or not.booleanrewrite(File f)booleanrewrite(File f, File backup)Deprecated.SECURITY-376:backupis ignoredintrewriteRecursive(File dir, TaskListener listener)Recursively scans and rewrites a directory.
-
-
-
Constructor Detail
-
SecretRewriter
public SecretRewriter() throws GeneralSecurityException- Throws:
GeneralSecurityException
-
SecretRewriter
@Deprecated public SecretRewriter(File backupDirectory) throws GeneralSecurityException
Deprecated.SECURITY-376:backupDirectoryis ignored- Throws:
GeneralSecurityException
-
-
Method Detail
-
rewrite
@Deprecated public boolean rewrite(File f, File backup) throws InvalidKeyException, IOException
Deprecated.SECURITY-376:backupis ignored- Throws:
InvalidKeyExceptionIOException
-
rewrite
public boolean rewrite(File f) throws InvalidKeyException, IOException
- Throws:
InvalidKeyExceptionIOException
-
rewriteRecursive
public int rewriteRecursive(File dir, TaskListener listener) throws InvalidKeyException
Recursively scans and rewrites a directory. This method shouldn't abort just because one file fails to rewrite.- Returns:
- Number of files that were actually rewritten.
- Throws:
InvalidKeyException
-
isIgnoredDir
protected boolean isIgnoredDir(File dir)
Decides if this directory is worth visiting or not.
-
-