01: /*
02: * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.monitoring.security;
06:
07: import com.sun.portal.monitoring.security.sasl.SaslContext;
08:
09: import java.io.File;
10:
11: public class SaslConfiguration {
12: public SaslConfiguration(SaslContext saslContext) {
13: this .saslContext = saslContext;
14: }
15:
16: private SaslContext saslContext;
17:
18: public void createUserPassword(User user) throws SecurityException {
19: deleteUserPassword();
20: UserManager userManager = new UserManager(saslContext
21: .getPropertyHelper());
22: userManager.write(user, saslContext.getUserPasswordDirectory()
23: + File.separator
24: + saslContext.getUserPasswordFileName());
25: }
26:
27: public void deleteUserPassword() {
28: File file = new File(saslContext.getUserPasswordDirectory()
29: + File.separator
30: + saslContext.getUserPasswordFileName());
31: if (file.exists()) {
32: file.delete();
33: }
34: }
35: }
|