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:backupDirectory
is ignored
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
isIgnoredDir(File dir)
Decides if this directory is worth visiting or not.boolean
rewrite(File f)
boolean
rewrite(File f, File backup)
Deprecated.SECURITY-376:backup
is ignoredint
rewriteRecursive(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:backupDirectory
is ignored- Throws:
GeneralSecurityException
-
-
Method Detail
-
rewrite
@Deprecated public boolean rewrite(File f, File backup) throws InvalidKeyException, IOException
Deprecated.SECURITY-376:backup
is ignored- Throws:
InvalidKeyException
IOException
-
rewrite
public boolean rewrite(File f) throws InvalidKeyException, IOException
- Throws:
InvalidKeyException
IOException
-
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.
-
-