Main Page Cookbook/Overview ImageMeister the jcprops file Licensing Binary Installation & Configuration [ Win · Mac · Nix · OSX ] Changes Public API Source Code Main Page Java [ Common · Win · Mac · Nix ] Native Code [ Common · Win · Mac · Nix ] Manifest Native Code Overviews [ Common · Win · Mac · Nix · Strings ] Macros [ General · Native Macros ] Walkthroughs [ Java only · Java and native ] Building [ Win · Mac · Nix · OSX ] Distribution Issues

    All Packages  This Package  Class Hierarchy  Class Search  Index

Class com.jconfig.mac.DiskFileMRJ

    java.lang.Object
       |
       +----com.jconfig.mac.DiskFileMRJ

Summary

    class  DiskFileMRJ
         extends java.lang.Object
         implements com.jconfig.DiskFile,
                    com.jconfig.mac.IMacDiskObject
    {
              // Fields 8
         private boolean bAlreadyGotVersionInfo;
         private boolean bIsFolder;
         private static final String copyrightString;
         private byte[] pName;
         private int parID;
         private DiskVolume theVolume;
         private int vRef;
         private VersionInfoMRJ versionInfo;

              // Constructors 1
         DiskFileMRJ(int, int, byte[], boolean) throws FileNotFoundException, DiskFileException;

              // Methods 36
         public DiskObject createObject(String, int, int);
         public String diskFileFlagsToString(int);
         public void dumpInfo(PrintStream, String);
         public boolean exists();
         public int getColorCoding();
         public DiskObject getContainer() throws FileNotFoundException, DiskFileException;
         public DateBundle getDateBundle();
         protected String getDateString();
         public String getDisplayName();
         public File getFile();
         public long getFileSize();
         public FileSystem getFileSystem();
         public FinderInfo getFinderInfo();
         public int getFlags();
         public int getGetFlagsMask();
         public IconBundle getIconBundle();
         public String getName();
         public byte[] getPName();
         public int getParID();
         public int[] getPlatformData();
         public ResourceFork getResourceFork();
         public long getResourceForkSize();
         public int getSetFlagsMask();
         public String getShortName();
         public int getVRef();
         public VersionInfo getVersion();
         public DiskVolume getVolume();
         public int iterate(DiskFilter, int, int);
         private void makeVersionInfo();
         public int setColorCoding(int);
         public void setDateBundle(DateBundle);
         public int setFinderInfo(FinderInfo);
         public void setFlags(int, int);
         public int setIconBundle(IconBundle);
         public int setName(String);
         public int updateContainer();
    }

Implements the DiskFile interface on the Mac. See that interface for more information. Most of the methods call methods in AppUtilsMRJ to obtain system information using native code.

Author:
  Copyright (c) 1997-2002 Samizdat Productions. All Rights Reserved.

Cross Reference

Extended By:
  AppFileMRJ, AppFileOSX, DiskAliasMRJ

Fields

### · copyrightString | Summary | Top

       private static final String copyrightString

### · theVolume | Summary | Top

       private DiskVolume theVolume

> The volume containing this file or folder.

### · versionInfo | Summary | Top

       private VersionInfoMRJ versionInfo

> Version info on the file. Only created when needed.

### · vRef | Summary | Top

       private int vRef

> The vRefNum of this file's FSSpec.

### · parID | Summary | Top

       private int parID

> The parID of this file's FSSpec.

### · pName | Summary | Top

       private byte[] pName

> The name of this file's FSSpec.

### · bIsFolder | Summary | Top

       private boolean bIsFolder

> Indicates whether this is a folder.

### · bAlreadyGotVersionInfo | Summary | Top

       private boolean bAlreadyGotVersionInfo

> Used to lazily-create and cache the version info.

Constructors

### · DiskFileMRJ | Summary | Top

       DiskFileMRJ(int vRef,
                   int parID,
                   byte[] pName,
                   boolean bIsFolder)  throws FileNotFoundException, DiskFileException

> Create using fields similar to those in an FSSpec. Does not check whether the file or folder exists. The vRef must be valid, however.

> Parameter | Description
> vRef | the vRefNum of the file or folder
> parID | the parID of the file or folder
> pName | the name of the file or folder, as a Pascal string
> bIsFolder | set this to indicate whether this object is a file or folder

Methods

### · exists | Summary | Top

       public boolean exists()

> Checks whether this file or folder exists.

### · getName | Summary | Top

       public String getName()

> Returns the name in quoted-printable form. If the file does not exist, returns null.

### · getShortName | Summary | Top

       public String getShortName()

> Returns the the short version of the file's name, if applicable

> Implements:
>   getShortName in interface DiskFile

### · getFileSystem | Summary | Top

       public FileSystem getFileSystem()

> Returns the file system containing this object. Calls FSCreatorMRJ.getFileFileSystem().

### · setName | Summary | Top

       public int setName(String newName)

> Renames this object.

### · getDisplayName | Summary | Top

       public String getDisplayName()

> Returns the name of this object, as it would be displayed to the user.

### · getFlags | Summary | Top

       public int getFlags()

> Returns a set of binary flags associated with this object. These flags are defined in DiskFile.java. Use the 'getGetFlagsMask' method to find out which bits of the returned value are significant.

### · setFlags | Summary | Top

       public void setFlags(int whichFlags,
                            int newValues)

> Set the indicated flags.

> For more information on these flags, see:

>     http://developer.apple.com/technotes/tb/tb_09.html
>     http://developer.apple.com/techpubs/mac/Toolbox/Toolbox-455.html#MARKER-9-356

> Parameter | Description
> whichFlags | the mask indicating which bits in newValues are significant
> newValues | contains the bits to be set/reset.

> Throws: IllegalArgumentException
>   if whichFlags is 0

### · getGetFlagsMask | Summary | Top

       public int getGetFlagsMask()

> Returns a mask which indicates which bits returned by 'getFlags' are significant. For instance, if bit 0 of the return value of this method is set, bit 0 of 'getFlags' contains actual information, otherwise, this information is not available.

### · getSetFlagsMask | Summary | Top

       public int getSetFlagsMask()

> Returns a mask which indicates which bits in the argument to 'setFlags' can be set. For instance, if bit 0 of the return value of this method is set, bit 0 of 'setFlags' can be set.

### · getDateBundle | Summary | Top

       public DateBundle getDateBundle()

> Returns a DateBundle containing the creation, modification, and backup dates of this file or folder.

### · setDateBundle | Summary | Top

       public void setDateBundle(DateBundle newDates)

> Sets the set of dates associated with this file.

### · getIconBundle | Summary | Top

       public IconBundle getIconBundle()

> Returns an IconBundle for this file or folder.

### · setIconBundle | Summary | Top

       public int setIconBundle(IconBundle bndl)

> Not yet implemented.

> Throws: UnimplementedException
>   this method always throws an UnimplementedException

### · getColorCoding | Summary | Top

       public int getColorCoding()

> Returns the color coding of this object.

### · setColorCoding | Summary | Top

       public int setColorCoding(int newCoding)

> Sets the color coding of this object.

### · getFile | Summary | Top

       public File getFile()

> Determines the full path name of this object, and returns a java.io.File object created from that path. Returns null if an error occurs.

### · getFileSize | Summary | Top

       public long getFileSize()

> Returns the total length of this file.

> Implements:
>   getFileSize in interface DiskFile

### · getResourceForkSize | Summary | Top

       public long getResourceForkSize()

> Returns the length of this file's resource fork, or 0 if an error occurs.

> Implements:
>   getResourceForkSize in interface DiskFile

### · getVolume | Summary | Top

       public DiskVolume getVolume()

> Returns the DiskVolume containing this object.

> Implements:
>   getVolume in interface DiskFile

### · getVersion | Summary | Top

       public VersionInfo getVersion()

> The file's version info, if any, is assumed not to change and only created when needed and then cached.

> Implements:
>   getVersion in interface DiskFile

### · getPlatformData | Summary | Top

       public int[] getPlatformData()

> Return a two int array containing the vRef of the file in the first int and the parID in the second.

> Implements:
>   getPlatformData in interface DiskFile

### · getFinderInfo | Summary | Top

       public FinderInfo getFinderInfo()

> Returns the FinderInfo for this object.

> Implements:
>   getFinderInfo in interface DiskFile

### · setFinderInfo | Summary | Top

       public int setFinderInfo(FinderInfo newFI)

> Sets the FinderInfo (creator and type) for this object.

> Implements:
>   setFinderInfo in interface DiskFile

### · getVRef | Summary | Top

       public int getVRef()

> Returns the vRefNum.

> Implements:
>   getVRef in interface IMacDiskObject

### · getParID | Summary | Top

       public int getParID()

> Returns the parID.

> Implements:
>   getParID in interface IMacDiskObject

### · getPName | Summary | Top

       public byte[] getPName()

> Returns a copy of the name as a Pascal string.

> Implements:
>   getPName in interface IMacDiskObject

### · updateContainer | Summary | Top

       public int updateContainer()

> Updates the folder containing this object.

### · makeVersionInfo | Summary | Top

       private void makeVersionInfo()

> Open the resource fork, and try to read the <'VERS',1> resource.

### · iterate | Summary | Top

       public int iterate(DiskFilter filter,
                          int flags,
                          int maxToIterate)

> Call the DiskFilter's visit() method for each file/folder inside this folder. Calls FileIteratorMRJ.iterateFolder()

> Throws: IllegalArgumentException
>   if this is not a folder.

### · getContainer | Summary | Top

       public DiskObject getContainer()  throws FileNotFoundException, DiskFileException

> If this object is at the volume's root level, return the volume containing this object. Otherwise, return a DiskObject representing the folder containing this object.

### · diskFileFlagsToString | Summary | Top

       public String diskFileFlagsToString(int f)

> Convenience method which converts a given set of DiskFile flags into a string representation.

> Implements:
>   diskFileFlagsToString in interface DiskFile

### · createObject | Summary | Top

       public DiskObject createObject(String name,
                                      int type,
                                      int flags)

> Not yet implemented.

### · getResourceFork | Summary | Top

       public ResourceFork getResourceFork()

> Returns the ResourceForkMRJ object for this file.

> Implements:
>   getResourceFork in interface DiskFile

### · getDateString | Summary | Top

       protected String getDateString()

### · dumpInfo | Summary | Top

       public void dumpInfo(PrintStream ps,
                            String indent)

    All Packages  This Package  Class Hierarchy  Class Search  Index

Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7