01: /**
02: * $Id: SunOSTasks.java,v 1.6 2006/02/08 11:42:56 fo160993 Exp $
03: * Copyright 2004 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.fabric.util.os;
14:
15: import com.sun.portal.admin.common.context.PSConfigContext;
16:
17: import java.util.logging.Logger;
18: import java.util.logging.Level;
19: import java.util.logging.LogRecord;
20:
21: import com.sun.portal.log.common.PortalLogger;
22:
23: public class SunOSTasks extends UnixTasks {
24:
25: private static String fs = System.getProperty("file.separator");
26: private static Logger logger = PortalLogger
27: .getLogger(SunOSTasks.class);
28:
29: public SunOSTasks(PSConfigContext globalContext) {
30: super (globalContext);
31: }
32:
33: public void createSymbolicLink(String source, String target) {
34: String cmd = "/usr/bin/ln";
35: String[] args = { "-s", "-n", source, target };
36: try {
37: execUtil.exec(cmd, args);
38: } catch (Exception e) {
39: logger.log(Level.SEVERE, "PSFB_CSPFUOS0014", e);
40: }
41: }
42:
43: public void removeSymbolicLink(String target) {
44: String cmd = "/usr/sbin/unlink";
45: String[] args = { target };
46: try {
47: execUtil.exec(cmd, args);
48: } catch (Exception e) {
49: if (logger.isLoggable(Level.SEVERE)) {
50: LogRecord rec = new LogRecord(Level.SEVERE,
51: "PSFB_CSPFUOS0015");
52: rec.setLoggerName(logger.getName());
53: rec.setParameters(new Object[] { target });
54: rec.setThrown(e);
55: logger.log(rec);
56: }
57: }
58: }
59:
60: public void addNetFilePAM() {
61:
62: }
63:
64: }
|