All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class ORG.opengroup.beans.Naked

java.lang.Object
    |
    +----ORG.opengroup.beans.Naked

public class Naked
extends Object
Naked is a static class which supports Beans stored in the directory tree starting at the current working directory.

Naked requires that the CLASSPATH begins with ".". Otherwise new beans might not override old beans found elsewhere on the CLASSPATH.


Constructor Index

 o Naked()

Method Index

 o delete(String)
Delete bean.
 o exists(String)
Check if bean exists in the naked directory tree.
 o isNaked()
Return true if the CLASSPATH begins with ".".
 o load(String)
Load a Bean.
 o mkdirs(String)
Create directory from package name.
 o rename(String, String)
Rename a bean.
 o save(Object, String)
Save a Bean as a disk file in the directory tree starting at the current working directory.

Constructors

 o Naked
public Naked()

Methods

 o isNaked
public static boolean isNaked()
Return true if the CLASSPATH begins with ".". Unless this requirement is meet, new beans may not correctly override older beans found elsewhere on the CLASSPATH.

 o load
public static Object load(String name) throws IOException, ClassNotFoundException
Load a Bean. (Uses java.beans.Beans.instantiate.) The name of the bean must be of the form x.y.Z, where x.y is the full package name and Z is the class name.

Parameters:
name - Name of the class or bean
Returns:
the instantiated object
Throws: ClassNotFoundException
if the class of the bean could not be found
Throws: IOException
if an I/O error occurs
 o mkdirs
public static boolean mkdirs(String pck)
Create directory from package name.

Parameters:
pck - Package name
Returns:
True if the directory exists or was created
 o save
public static boolean save(Object obj,
                           String name) throws IOException
Save a Bean as a disk file in the directory tree starting at the current working directory. The name of the bean must be of the form x.y.Z, where x.y is the full package name and Z is the class name. The file saved under the name x/y/Z.ser (or x\y\Z.ser).

Parameters:
obj - Object to be saved
name - Name of the object
Returns:
True if the object was saved
Throws: IOException
if an I/O error occurs
 o rename
public static boolean rename(String oldNam,
                             String newNam)
Rename a bean. The names must be in the form x.y.Z, where x.y is the full package name and Z is the class name.

Parameters:
oldNam - Name of the bean to be renamed
newNam - The new name of the bean
Returns:
True if the rename was successful
 o delete
public static boolean delete(String name)
Delete bean. The name must be in the form x.y.Z, where x.y is the full package name and Z is the class name.

Parameters:
name - Name of the bean to be deleted.
Returns:
True if the delete was successful.
 o exists
public static boolean exists(String name)
Check if bean exists in the naked directory tree. The name must be in the form x.y.Z, where x.y is the full package name and Z is the class name.

Parameters:
name - Name of the bean to be deleted.
Returns:
True if the delete was successful.

All Packages  Class Hierarchy  This Package  Previous  Next  Index