01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: //
07: package com.sun.portal.ffj.filesystems;
08:
09: import java.io.*;
10: import java.beans.*;
11:
12: import org.openide.filesystems.*;
13: import org.openide.TopManager;
14:
15: public class PortletJarFS extends JarFileSystem {
16:
17: public PortletJarFS() {
18: super ();
19: }
20:
21: public PortletJarFS(FileSystemCapability cap) {
22: super (cap);
23: }
24:
25: private static void create() throws IOException,
26: PropertyVetoException {
27: File jf = PSFSInstall.getPortletJarFile();
28:
29: System.out.println("Creating Portlet Jar FS - " + jf);
30: m_FS = new PortletJarFS();
31: m_FS.setJarFile(jf);
32: m_FS.setHidden(true);
33: TopManager.getDefault().getRepository().addFileSystem(m_FS);
34: System.out.println("Mounted - " + jf);
35: }
36:
37: public static void mount() throws IOException,
38: PropertyVetoException {
39: if (m_FS == null) {
40: create();
41: }
42: }
43:
44: public static void unmount() {
45: if (m_FS != null) {
46: System.out.println("Unmounting Portlet Jar FS");
47: TopManager.getDefault().getRepository().removeFileSystem(
48: m_FS);
49: m_FS = null;
50: }
51: }
52:
53: private static PortletJarFS m_FS = null;
54: }
|