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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SecretRewriter
public SecretRewriter(File backupDirectory)
throws GeneralSecurityException
- Throws:
GeneralSecurityException
rewrite
public boolean rewrite(File f,
File backup)
throws InvalidKeyException,
IOException
- Parameters:
backup
- if non-null, the original file will be copied here before rewriting.
if the rewrite doesn't happen, no copying.
- 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.
Copyright © 2004-2013. All Rights Reserved.