All Packages This Package Class Hierarchy Class Search Index
Class com.jconfig.mac.AppUtilsMRJ
java.lang.Object
|
+----com.jconfig.mac.AppUtilsMRJ
class AppUtilsMRJ
extends java.lang.Object
{
// Fields 61
static final int DATE_BKUP_OFFSET;
static final int DATE_CRE_OFFSET;
static final int DATE_MOD_OFFSET;
static final int FI_ARRAYLEN;
static final int FI_OFFS_ATTRIBUTES;
static final int FI_OFFS_CRE;
static final int FI_OFFS_FLAGS;
static final int FI_OFFS_TYPE;
private static final String copyrightString;
static final int kCategoryAlias;
static final int kCategoryDirectory;
static final int kCategoryFile;
static final int kCategoryOSXAliasFileBit;
static final int kCategoryOSXAppIsScriptableBit;
static final int kCategoryOSXAppPrefersClassicBit;
static final int kCategoryOSXAppPrefersNativeBit;
static final int kCategoryOSXApplicationBit;
static final int kCategoryOSXClassicAppBit;
static final int kCategoryOSXContainerBit;
static final int kCategoryOSXExtendedInfoBit;
static final int kCategoryOSXExtensionIsHiddenBit;
static final int kCategoryOSXInvisibleBit;
static final int kCategoryOSXNativeAppBit;
static final int kCategoryOSXPackageBit;
static final int kCategoryOSXPlainFileBit;
static final int kCategoryOSXSymlinkBit;
static final int kCategoryOSXVolumeBit;
static final int kCategoryUnknown;
static final int kCategoryVolume;
static final int kDateBundleArrayLen;
static final int kFinderFlagsColorMask;
static final int kForkSizesDataOffset;
static final int kForkSizesLen;
static final int kForkSizesRsrcOffset;
static final int kGetProcessesNameLen;
static final int kIterateBufferSize;
static final int kIterateEntrySize;
static final int kIterateFlagsOffset;
static final int kIterateIsAlias;
static final int kIterateIsDir;
static final int kIterateIsFile;
static final int kIterateIsHiddenMask;
static final int kIterateMaxEntries;
static final int kIterateNameSize;
static final int kIterateTypeOffset;
static final int kLaunchWithDocOpenDoc;
static final int kLaunchWithDocPrintDoc;
static final int kMonitorInfoNumInts;
static final int kPNameLen;
static final int kPSNHiOffset;
static final int kPSNLen;
static final int kPSNLoOffset;
static final int kParIDOffset;
static final int kRefPairLen;
static final int kSendAppDocsOpenDoc;
static final int kSendAppDocsPrintDoc;
static final int kSetForkLengthDATA;
static final int kSetForkLengthRSRC;
private static final int kUnused;
static final int kVRefOffset;
private static IToolboxLock lockObject;
// Constructors 1
private AppUtilsMRJ();
// Methods 170
static int createAlias(int, int, byte[], String, int, int);
static String createFullPathName(int, int, byte[]);
static int createVolumeAlias(int, String, int, int);
static int disposeIconSuite(int, int);
static void dumpCategory(PrintStream, int);
static int fullPathToSpec(String, int[], byte[]);
static int getAllMonitorInfo(int[], int, int[]);
static int getContainer(int, int, byte[], int[], byte[]);
static int getDiskFileFlags(int, int, byte[], int[]);
static int getDiskFileReadFlagsMask(int, int, byte[], int[]);
static int getDiskFileWriteFlagsMask(int, int, byte[], int[]);
static int getDiskVolumeFlags(int, int[]);
static int getDiskVolumeReadFlagsMask(int, int[]);
static int getDiskVolumeWriteFlagsMask(int, int[]);
static int getFTACIconSuite(int, int, int, int, int[]);
static int getFileCategory(int, int, byte[], int[]);
static int getFileDate(int, int, byte[], int[]);
static int getFileIconSuite(int, int, byte[], int, int[]);
static int getFinderInfo(int, int, byte[], int[]);
static int getForkSizes(int, int, byte[], long[]);
static IToolboxLock getLockObject();
static int getMainMonitorInfo(int[]);
static int getOpenableFileTypes(int, int, int[], int[]);
static int getProcesses(int, int, int[], int[], int[], byte[], int[], int[], int[]);
static int getRawResourceFork(int, int, int, byte[], byte[]);
static int getVolumeCapacity(int, long[]);
static int getVolumeDate(int, int[]);
static int getVolumeFinderInfo(int, int[]);
static int getVolumeFreeSpace(int, long[]);
static int getVolumeIconSuite(int, int, int[]);
static int getVolumeName(int, byte[]);
static int getVolumes(int, int[], int[]);
static int iterateContents(int, int, byte[], int[], int[], byte[], int, int);
static int iterateVolumeContents(int, int[], int[], byte[], int, int);
static int launchApp(int, int, byte[], int[], int);
static int launchURL(String, int, String[]);
static int launchWithDoc(int, int, int, byte[], String[], int[], int);
static int moveApp(int[], int, int);
private static native int n(int, int, byte[], int[]);
private static native int nCreateAlias(int, int, byte[], String, int, int);
private static native int nCreateFullPathName(int, int, byte[], String[]);
private static native int nCreateVolumeAlias(int, String, int, int);
private static native int nDisposeIconSuite(int, int);
private static native int nFullPathToSpec(String, int[], byte[]);
private static native int nGetAllMonitorInfo(int[], int, int[]);
private static native int nGetContainer(int, int, byte[], int[], byte[]);
private static native int nGetDFReadFlagsMask(int, int, byte[], int[]);
private static native int nGetDFWriteFlagsMask(int, int, byte[], int[]);
private static native int nGetDVReadFlagsMask(int, int[]);
private static native int nGetDVWriteFlagsMask(int, int[]);
private static native int nGetDiskFileFlags(int, int, byte[], int[]);
private static native int nGetDiskVolumeFlags(int, int[]);
private static native int nGetFTACIconSuite(int, int, int, int, int[]);
private static native int nGetFileCategory(int, int, byte[], int[]);
private static native int nGetFileDate(int, int, int, byte[], int[]);
private static native int nGetFileIconSuite(int, int, byte[], int, int[]);
private static native int nGetFinderInfo(int, int, byte[], int[]);
private static native int nGetForkSizes(int, int, byte[], long[]);
private static native int nGetMainMonitorInfo(int[]);
private static native int nGetOpenableFileTypes(int, int, int[], int[]);
private static native int nGetProcesses(int, int, int[], int[], int[], byte[], int[], int[], int[]);
private static native int nGetRawResourceFork(int, int, int, byte[], byte[]);
private static native int nGetVolumeCapacity(int, long[]);
private static native int nGetVolumeDate(int, int, int[]);
private static native int nGetVolumeFinderInfo(int, int[]);
private static native int nGetVolumeFreeSpace(int, long[]);
private static native int nGetVolumeIconSuite(int, int, int[]);
private static native int nGetVolumeName(int, byte[]);
private static native int nGetVolumes(int, int[], int[]);
private static native int nIVC(int, int[], int[], byte[], int, int);
private static native int nIterateContents(int, int, byte[], int[], int[], byte[], int, int);
private static native int nLaunchApp(int, int, byte[], int[], int);
private static native int nLaunchURLDirect(String, int, String[]);
private static native int nLaunchWithDoc(int, int, int, byte[], String[], int[], int);
private static native int nMoveApp(int[], int, int);
private static native int nPlotIcon(int, int, int, int, int, int, int[]);
private static native int nQuitApp(int[], int);
private static native int nRenameFile(int, int, byte[], byte[], String);
private static native int nRenameVolume(int, String);
private static native int nResolveAlias(int, int, byte[], int[], byte[], int);
private static native int nSendAppDocs(int, int[], String[], int);
private static native int nSetColorCoding(int, int, byte[], int);
private static native int nSetCreatorAndType(int, int, byte[], int[]);
private static native int nSetDiskFileFlags(int, int, byte[], int, int);
private static native int nSetDiskVolumeFlags(int, int, int);
private static native int nSetFileDate(int, int, int, byte[], int[]);
private static native int nSetForkLength(int, int, int, int, byte[], long);
private static native int nSetRawResourceFork(int, int, int, byte[], byte[]);
private static native int nSetVolumeColorCoding(int, int);
private static native int nSetVolumeDate(int, int, int[]);
private static native int nUpdateContainer(int, int, byte[]);
private static native int nVerifyFile(int, int, byte[]);
private static native int nVerifyPSN(int[]);
private static native int nVerifyVolume(int);
static int plotIcon(int, int, int, int, int, int, int[]);
static int quitApp(int[], int);
static int renameFile(int, int, byte[], byte[], String);
static int renameVolume(int, String);
static int resolveAlias(int, int, byte[], int[], byte[], int);
static int sendAppDocs(int, int[], String[], int);
static int setColorCoding(int, int, byte[], int);
static int setCreatorAndType(int, int, byte[], int[]);
static int setDiskFileFlags(int, int, byte[], int, int);
static int setDiskVolumeFlags(int, int, int);
static int setFileDate(int, int, byte[], int[]);
static int setForkLength(int, int, int, int, byte[], long);
static void setLockObject(IToolboxLock);
static int setRawResourceFork(int, int, int, byte[], byte[]);
static int setVolumeColorCoding(int, int);
static int setVolumeDate(int, int[]);
static void testLink();
static int updateContainer(int, int, byte[]);
static int verifyFile(int, int, byte[]);
static int verifyPSN(int[]);
static int verifyVolume(int);
private static int wrap_nCreateAlias(int, int, byte[], String, int, int);
private static int wrap_nCreateFullPathName(int, int, byte[], String[]);
private static int wrap_nCreateVolumeAlias(int, String, int, int);
private static int wrap_nDisposeIconSuite(int, int);
private static int wrap_nFullPathToSpec(String, int[], byte[]);
private static int wrap_nGetAllMonitorInfo(int[], int, int[]);
private static int wrap_nGetContainer(int, int, byte[], int[], byte[]);
private static int wrap_nGetDFReadFlagsMask(int, int, byte[], int[]);
private static int wrap_nGetDFWriteFlagsMask(int, int, byte[], int[]);
private static int wrap_nGetDVReadFlagsMask(int, int[]);
private static int wrap_nGetDVWriteFlagsMask(int, int[]);
private static int wrap_nGetDiskFileFlags(int, int, byte[], int[]);
private static int wrap_nGetDiskVolumeFlags(int, int[]);
private static int wrap_nGetFTACIconSuite(int, int, int, int, int[]);
private static int wrap_nGetFileCategory(int, int, byte[], int[]);
private static int wrap_nGetFileDate(int, int, int, byte[], int[]);
private static int wrap_nGetFileIconSuite(int, int, byte[], int, int[]);
private static int wrap_nGetFinderInfo(int, int, byte[], int[]);
private static int wrap_nGetForkSizes(int, int, byte[], long[]);
private static int wrap_nGetMainMonitorInfo(int[]);
private static int wrap_nGetOpenableFileTypes(int, int, int[], int[]);
private static int wrap_nGetProcesses(int, int, int[], int[], int[], byte[], int[], int[], int[]);
private static int wrap_nGetRawResourceFork(int, int, int, byte[], byte[]);
private static int wrap_nGetVolumeCapacity(int, long[]);
private static int wrap_nGetVolumeDate(int, int, int[]);
private static int wrap_nGetVolumeFinderInfo(int, int[]);
private static int wrap_nGetVolumeFreeSpace(int, long[]);
private static int wrap_nGetVolumeIconSuite(int, int, int[]);
private static int wrap_nGetVolumeName(int, byte[]);
private static int wrap_nGetVolumes(int, int[], int[]);
private static int wrap_nIVC(int, int[], int[], byte[], int, int);
private static int wrap_nIterateContents(int, int, byte[], int[], int[], byte[], int, int);
private static int wrap_nLaunchApp(int, int, byte[], int[], int);
private static int wrap_nLaunchURLDirect(String, int, String[]);
private static int wrap_nLaunchWithDoc(int, int, int, byte[], String[], int[], int);
private static int wrap_nMoveApp(int[], int, int);
private static int wrap_nPlotIcon(int, int, int, int, int, int, int[]);
private static int wrap_nQuitApp(int[], int);
private static int wrap_nRenameFile(int, int, byte[], byte[], String);
private static int wrap_nRenameVolume(int, String);
private static int wrap_nResolveAlias(int, int, byte[], int[], byte[], int);
private static int wrap_nSendAppDocs(int, int[], String[], int);
private static int wrap_nSetColorCoding(int, int, byte[], int);
private static int wrap_nSetCreatorAndType(int, int, byte[], int[]);
private static int wrap_nSetDiskFileFlags(int, int, byte[], int, int);
private static int wrap_nSetDiskVolumeFlags(int, int, int);
private static int wrap_nSetFileDate(int, int, int, byte[], int[]);
private static int wrap_nSetForkLength(int, int, int, int, byte[], long);
private static int wrap_nSetRawResourceFork(int, int, int, byte[], byte[]);
private static int wrap_nSetVolumeColorCoding(int, int);
private static int wrap_nSetVolumeDate(int, int, int[]);
private static int wrap_nUpdateContainer(int, int, byte[]);
private static int wrap_nVerifyFile(int, int, byte[]);
private static int wrap_nVerifyPSN(int[]);
private static int wrap_nVerifyVolume(int);
}
Contains static methods which call native methods. Contains most of the Mac native code.
Many of the methods of this file are simply wrappers around the private native methods.
Almost all of these methods return an error code; 0 means success, other values indicate some
form of error.
The term 'WANC' in the documentation means that that method is just a Wrapper Around Native Code.
- Author:
-
Copyright (c) 1997-2002 Samizdat Productions. All Rights Reserved.
private static final String copyrightString
static final int FI_ARRAYLEN
static final int FI_OFFS_CRE
static final int FI_OFFS_TYPE
static final int FI_OFFS_FLAGS
static final int FI_OFFS_ATTRIBUTES
static final int kLaunchWithDocOpenDoc
static final int kLaunchWithDocPrintDoc
static final int kSendAppDocsOpenDoc
static final int kSendAppDocsPrintDoc
static final int kCategoryVolume
static final int kCategoryDirectory
static final int kCategoryFile
static final int kCategoryAlias
static final int kCategoryUnknown
static final int kCategoryOSXExtendedInfoBit
static final int kCategoryOSXPlainFileBit
static final int kCategoryOSXPackageBit
static final int kCategoryOSXApplicationBit
static final int kCategoryOSXContainerBit
static final int kCategoryOSXAliasFileBit
static final int kCategoryOSXSymlinkBit
static final int kCategoryOSXInvisibleBit
static final int kCategoryOSXNativeAppBit
static final int kCategoryOSXClassicAppBit
static final int kCategoryOSXAppPrefersNativeBit
static final int kCategoryOSXAppPrefersClassicBit
static final int kCategoryOSXAppIsScriptableBit
static final int kCategoryOSXVolumeBit
static final int kCategoryOSXExtensionIsHiddenBit
static final int kPNameLen
The length of a Pascal string; for many methods which accept a writable byte array as an argument,
the array must have at least this many elements.
static final int kPSNLen
The length of an array used to hold a ProcessSerialNumber
static final int kPSNLoOffset
The offset of the low int of a ProcessSerialNumber
static final int kPSNHiOffset
The offset of the high int of a ProcessSerialNumber
static final int kRefPairLen
The length of an array used to hold a vRef and parID
static final int kVRefOffset
The offset of the vRef in an array used to hold a vRef and parID
static final int kParIDOffset
The offset of the parID in an array used to hold a vRef and parID
static final int kForkSizesLen
The length of an array used to hold the length of a file's data and resource forks.
static final int kForkSizesDataOffset
The offset of the data fork size in an array used to hold the length of a file's data and resource forks.
static final int kForkSizesRsrcOffset
The offset of the resource fork size in an array used to hold the length of a file's data and resource forks.
static final int kFinderFlagsColorMask
static final int kIterateEntrySize
See iterateContents()
static final int kIterateMaxEntries
See iterateContents()
static final int kIterateBufferSize
See iterateContents()
static final int kIterateNameSize
See iterateContents()
static final int kIterateTypeOffset
See iterateContents()
static final int kIterateFlagsOffset
See iterateContents()
static final int kIterateIsFile
See iterateContents()
static final int kIterateIsDir
See iterateContents()
static final int kIterateIsAlias
See iterateContents()
static final int kIterateIsHiddenMask
See iterateContents()
static final int kMonitorInfoNumInts
Used in retrieving monitor information; see the 'getAllMonitorInfo' method.
static final int kGetProcessesNameLen
static final int kDateBundleArrayLen
The getFileDate() and getVolumeDate() methods are passed
an array of java ints, into which the native code puts the modification,
creation and access dates. Each date takes 6 ints: year, month, day,
hour, minute, and second. This defines the total length of the jint array.
static final int DATE_MOD_OFFSET
The offset of the modification date in the array passed to getFileDate() and getVolumeDate().
static final int DATE_CRE_OFFSET
The offset of the creation date in the array passed to getFileDate() and getVolumeDate().
static final int DATE_BKUP_OFFSET
The offset of the backup date in the array passed to getFileDate() and getVolumeDate().
static final int kSetForkLengthDATA
See the 'whichFork' argument to setForkLength().
static final int kSetForkLengthRSRC
private static final int kUnused
private static IToolboxLock lockObject
private AppUtilsMRJ()
static void setLockObject(IToolboxLock lock)
static IToolboxLock getLockObject()
static void dumpCategory(PrintStream ps,
int category)
static String createFullPathName(int vRef,
int parID,
byte[] pName)
Returns a full path name created from an FSSpec.
The name will be in MRJ format: quoted-printable, and with '/' as the separator.
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
static int getProcesses(int maxToReturn,
int flags,
int[] numRet,
int[] vRefs,
int[] parIDs,
byte[] pNames,
int[] psnLo,
int[] psnHi,
int[] proFlags)
Gets a list of the running processes.
Information on each process is placed into a series of arrays.
WANC
Parameter | Description |
maxToReturn | the lengths of the 'vRefs', 'parIDs', 'psnLo', 'psnHi', and 'proFlags' arrays. |
flags | 0 or a combination of the FileRegistry.kGetProcesses??? flags |
numRet | the number of processes returned will be placed at numRet[ 0 ] |
vRefs | the vRefNum of the file of each process will be placed at each element of this array.
Must have at least 'maxToReturn' elements. |
parIDs | the parID of the file of each process will be placed at each element of this array.
Must have at least 'maxToReturn' elements. |
pNames | the name of the file of each process will be placed into this array; each name will
be a Pascal string, and will occupy 'kGetProcessesNameLen' elements.
Must have at least 'maxToReturn' * 'kGetProcessesNameLen' elements. |
psnLo | the low int of the process' PSN will be placed at each element of this array.
Must have at least 'maxToReturn' elements. |
psnHi | the high int of the process' PSN will be placed at each element of this array.
Must have at least 'maxToReturn' elements. |
proFlags | flags on the process will be placed at each element of this array.
Not currently used.
Must have at least 'maxToReturn' elements. |
static int getAllMonitorInfo(int[] monitorInfo,
int maxToReturn,
int[] numReturned)
Gets information on all the user's monitors.
Info on each monitor will be placed into the 'monitorInfo' int array. Each monitor consumes 'kMonitorInfoNumInts'
elements of this array. The format of each monitor is as described in the 'getMainMonitorInfo' method.
WANC
Parameter | Description |
montitorInfo | must have at least 'maxToReturn' * kMonitorInfoNumInts elements. |
maxToReturn | the maximum number of monitors to return info on. |
numReturned | the number of monitors returned will be placed at numReturned[ 0 ] |
static int getMainMonitorInfo(int[] monitorInfo)
Stores information on the user's main monitor into the 'monitorInfo' array.
This array must have at least 'kMonitorInfoNumInts' elements.
The information on the monitor is stored at the 'kOffs???' offsets defined in 'MonitorMRJ.java':
WANC
static int launchApp(int vRef,
int parID,
byte[] pName,
int[] retPSN,
int flags)
Launches an app without any arguments.
WANC
Parameter | Description |
vRef | the vRefNum of the app's file |
parID | the parID of the app's file |
pName | the name of the app's file, as a Pascal string |
retPSN | on return, the process' PSN will be stored in this array, the low int of the PSN at
'kPSNLoOffset', and the high int at 'kPSNHiOffset' |
flags | 0, or AppFile.AF_NO_LAYER_SWITCH |
static int launchWithDoc(int whichCommand,
int vRef,
int parID,
byte[] pName,
String[] filePaths,
int[] retPSN,
int flags)
Launches an app with one or more documents.
WANC
Parameter | Description |
whichCommand | either kLaunchWithDocOpenDoc or kLaunchWithDocPrintDoc |
vRef | the vRefNum of the app's file |
parID | the parID of the app's file |
pName | the name of the app's file, as a Pascal string |
filePaths | the full paths of the files to open the app with |
retPSN | on return, the process' PSN will be stored in this array, the low int of the PSN at
'kPSNLoOffset', and the high int at 'kPSNHiOffset' |
flags | 0, or AppFile.AF_NO_LAYER_SWITCH |
static int getContainer(int vRef,
int parID,
byte[] pName,
int[] pContParID,
byte[] pContName)
Get the folder which contains a file.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
pContParID | the parID of the container will be placed at pContParID[ 0 ] |
pContName | the name of the container will be placed into this array as a Pascal string.
Must have kPNameLen or more elements. |
static int iterateContents(int vRef,
int parID,
byte[] pName,
int[] dirIDArray,
int[] numRet,
byte[] buffer,
int numEntries,
int flags)
Get the names and other information on the objects inside a folder.
The native code puts information on each file or folder into a byte array.
Each entry in this array is 'kIterateEntrySize' bytes long; the name of the object occupies the first
'kIterateNameSize' bytes.
The type of the object is stored at offset 'kIterateTypeOffset', and will
have the value 'kIterateIsFile', 'kIterateIsDir', or 'kIterateIsAlias'.
Flags on the object are stored at offset 'kIterateFlagsOffset'. This is not currently used.
WANC
Parameter | Description |
vRef | the vRefNum of the folder |
parID | the parID of the folder |
pName | the name of the folder, as a Pascal string |
dirIDArray | the dirID of the folder will be placed at dirIDArray[ 0 ] |
numRet | the number of objects returned will be placed at numRet[ 0 ] |
buffer | will hold information on each object, in the format given above. |
numEntries | the number of entries which 'buffer' can hold |
flags | 0, or one or more of the FileRegistry.kIgnore??? flags |
static int iterateVolumeContents(int vRef,
int[] dirIDArray,
int[] numRet,
byte[] buffer,
int numEntries,
int flags)
Get the names and other information on the objects inside the root level of a volume.
The native code puts information on each file or folder into a byte array in the same format as
described for the 'iterateContents' method.
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
dirIDArray | the dirID of the volume will be placed at dirIDArray[ 0 ] |
numRet | the number of objects returned will be placed at numRet[ 0 ] |
buffer | will hold information on each object, in the format described for the 'iterateContents' method. |
numEntries | the number of entries which 'buffer' can hold |
flags | 0, or one or more of the FileRegistry.kIgnore??? flags |
static int createVolumeAlias(int targetVRef,
String newAlias,
int creator,
int flags)
Creates an alias to a volume
WANC
Parameter | Description |
targetVRef | the vRefNum of the target volume |
newAlias | the full path of the new alias |
creator | ignored; set to 0 |
flags | Needs to be documented |
static int getVolumeFinderInfo(int vRef,
int[] finfo)
Gets the FinderInfo for a volume.
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
on | return, contains the finder info |
static int setColorCoding(int vRef,
int parID,
byte[] pName,
int newCoding)
Sets the color coding of a file.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
newCoding | the new color coding |
static int setVolumeColorCoding(int vRef,
int newCoding)
Sets the color coding of a volume.
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
newCoding | the new color coding |
static int getFileCategory(int vRef,
int parID,
byte[] pName,
int[] cat)
Gets the type of a file.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
cat | the type of the file will be placed at cat[ 0 ], and will be one of the 'kCategory???' values |
static int resolveAlias(int inVRef,
int inParID,
byte[] pInName,
int[] outVRefAndParID,
byte[] pOutName,
int flags)
Resolves an alias file.
WANC
Parameter | Description |
inVRef | the vRefNum of the alias |
inParID | the parID of the alias |
pInName | the name of the alias, as a Pascal string |
outVRefAndParID | the vRef of the resolved alias will be placed at vRefAndParID[ 0 ]
the parID of the resolved alias will be placed at vRefAndParID[ 1 ] |
pOutName | the name of the resolved alias will be placed in this array as a Pascal string.
This array must have at least kPNameLen elements. |
flags | either FileRegistry.ALIAS_UI or FileRegistry.ALIAS_NO_UI |
static int createAlias(int vRef,
int parID,
byte[] pName,
String newAlias,
int creator,
int flags)
Creates an alias to a file or folder.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
newAlias | the full path of the new alias |
creator | Needs to be documented |
flags | Needs to be documented |
static int getVolumeCapacity(int vRef,
long[] cap)
Returns the capacity of a volume
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
cap | the capacity will be placed at cap[ 0 ] |
static int getVolumeFreeSpace(int vRef,
long[] space)
Returns the free space of a volume
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
cap | the free space will be placed at cap[ 0 ] |
static int getVolumeName(int vRef,
byte[] pName)
Gets the name of a volume
WANC
Parameter | Description |
vRef | the vRefNum |
pName | the name will be placed in this array as a Pascal string
This array must have at least kPNameLen elements. |
static int renameVolume(int vRef,
String newName)
Renames a volume.
WANC
Parameter | Description |
vRef | the vRefNum |
newName | the new name of the volume |
static int renameFile(int vRef,
int parID,
byte[] pName,
byte[] pOutName,
String newName)
Renames a file or folder.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
pOutName | returns the new name of the file, as a Pascal string
Must have at least kPNameLen elements. |
newName | the new name of the file |
static int getForkSizes(int vRef,
int parID,
byte[] pName,
long[] sizes)
Gets the sizes of a file's data and resource forks.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
sizes | must have at least kForkSizesLen elements
the data fork size will be placed at sizes[ kForkSizesDataOffset ], and
the resource fork size will be placed at sizes[ kForkSizesRsrcOffset ] |
static int updateContainer(int vRef,
int parID,
byte[] pName)
Updates the folder which contains a file.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
static int getDiskVolumeFlags(int vRef,
int[] flags)
Gets the flags for a volume. These flags are defined in DiskVolume.java.
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
flags | the flags will be placed at flags[ 0 ] |
static int setDiskVolumeFlags(int vRef,
int flagMask,
int newFlags)
Sets the flags for a volume. These flags are defined in DiskVolume.java.
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
flagsMask | indicates which flags in newFlags are significant |
newFlags | which flags to set or reset |
static int getDiskVolumeReadFlagsMask(int vRef,
int[] masks)
Indicates which flags returned by 'getDiskVolumeFlags' are significant.
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
masks | the mask will be placed at masks[ 0 ] |
static int getDiskVolumeWriteFlagsMask(int vRef,
int[] masks)
Indicates which flags can be set for the volume.
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
masks | the mask will be placed at masks[ 0 ] |
static int getVolumes(int maxToReturn,
int[] numRet,
int[] vRefs)
Gets the vRefNums of the currently mounted volumes.
WANC
Parameter | Description |
maxToReturn | the maximum number of volumes to return |
numRet | the number returned will be placed at numRet[ 0 ] |
vRefs | the vRefNum of each volume will be placed in this array.
Must have at least 'maxToReturn' elements. |
static int getFTACIconSuite(int vRef,
int creator,
int type,
int selector,
int[] pHSuite)
Gets the icon suite for a file type.
WANC
Parameter | Description |
vRef | the volume to search for that type |
creator | the file's creator |
type | the file's type |
selector | unused; set to 0 |
pHSuite | the suite's handle will be placed at pHSuite[ 0 ] |
static int getVolumeIconSuite(int vRef,
int selector,
int[] pHSuite)
Gets the icon suite for a volume.
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
selector | unused; set to 0 |
pHSuite | the suite's handle will be placed at pHSuite[ 0 ] |
static int getFileIconSuite(int vRef,
int parID,
byte[] pName,
int selector,
int[] pHSuite)
Gets the icon suite for a file.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
selector | unused; set to 0 |
pHSuite | the suite's handle will be placed at pHSuite[ 0 ] |
static int plotIcon(int which,
int width,
int height,
int hSuite,
int xform,
int align,
int[] pData)
Draws an icon of an icon suite.
WANC
Parameter | Description |
which | either IconBundle.ICON_LARGE or IconBundle.ICON_SMALL |
width | the width of the icon |
height | the height of the icon |
hSuite | the icon suite |
xform | any transformation to be applied to the icon |
align | any alignment to tbe applied to the icon |
pData | an array of ints which will hold the Java format ARGB data for the icon
This must have at least width * height elements |
static int disposeIconSuite(int hSuite,
int flags)
Disposes an icon suite.
WANC
Parameter | Description |
hSuite | the icon suite |
flags | passed to Mac API DisposeIconSuite() |
static int getDiskFileFlags(int vRef,
int parID,
byte[] pName,
int[] flags)
Gets the flags for a file. These flags are defined in DiskFile.java.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
flags | the flags will be placed at flags[ 0 ] |
static int setDiskFileFlags(int vRef,
int parID,
byte[] pName,
int flagMask,
int newFlags)
Sets the flags for a file. These flags are defined in DiskFile.java.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
flagsMask | indicates which flags in newFlags are significant |
newFlags | which flags to set or reset |
static int getDiskFileReadFlagsMask(int vRef,
int parID,
byte[] pName,
int[] masks)
Indicates which flags returned by 'getDiskVolumeFlags' are significant.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
masks | the mask will be placed at masks[ 0 ] |
static int getDiskFileWriteFlagsMask(int vRef,
int parID,
byte[] pName,
int[] masks)
Indicates which flags can be set for the file.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
masks | the mask will be placed at masks[ 0 ] |
static int verifyFile(int vRef,
int parID,
byte[] pName)
Verifies whether a file exists.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
static int verifyVolume(int vRef)
Verifies whether a volume is still mounted.
WANC
Parameter | Description |
vRef | the vRefNum of the volume |
static int fullPathToSpec(String fullPath,
int[] vRefAndParID,
byte[] pName)
Converts a full path name to a FSSpec.
WANC
Parameter | Description |
fullPath | the full path, in MRJ format: quoted-printable, and with '/' as the separator. |
vRefAndParID | the vRef of the file will be placed at vRefAndParID[ 0 ]
the parID of the file will be placed at vRefAndParID[ 1 ] |
pName | the name of the file will be placed in this array, in Pascal format
This array must have at least kPNameLen elements. |
static int getFinderInfo(int vRef,
int parID,
byte[] pName,
int[] finfo)
Gets the creator, type, flags, and attributes of a file.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
finfo | information on the file will be placed in this array.
This must have at least 4 elements, which will be placed as follows:
creator at finfo[ 0 ], type at finfo[ 1 ], flags at finfo[ 2 ], attribs at finfo[ 3 ] |
static int setCreatorAndType(int vRef,
int parID,
byte[] pName,
int[] creatorAndType)
Sets the FinderInfo of a file.
WANC
Parameter | Description |
vRef | the vRefNum of the file |
parID | the parID of the file |
pName | the name of the file, as a Pascal string |
creatorAndType | the new creator should be at creatorAndType[ 0 ], and the new type at creatorAndType[ 1 ] |
static int sendAppDocs(int whichCommand,
int[] appPSN,
String[] filePaths,
int flags)
Sends an AppleEvent to a process.
WANC
Parameter | Description |
whichCommand | either 'kSendAppDocsOpenDoc' or 'kSendAppDocsPrintDoc' |
appPSN | the PSN of the process. The low int of the PSN should be at 'kPSNLoOffset',
and the high int at 'kPSNHiOffset' |
filePaths | full paths of the documents to be sent to the app |
flags | unused; set to 0 |
static int quitApp(int[] appPSN,
int flags)
Quits a process.
WANC
Parameter | Description |
appPSN | the PSN of the process. The low int of the PSN should be at 'kPSNLoOffset',
and the high int at 'kPSNHiOffset' |
flags | unused; set to 0 |
static int moveApp(int[] appPSN,
int selector,
int flags)
Moves a process.
WANC
Parameter | Description |
appPSN | the PSN of the process. The low int of the PSN should be at 'kPSNLoOffset',
and the high int at 'kPSNHiOffset' |
selector | one of the values defined in FileRegistry: 'APP_MOVE_TOFRONT', etc. |
flags | unused; set to 0 |
static int verifyPSN(int[] appPSN)
Verifies that a process is still running.
WANC
Parameter | Description |
appPSN | the PSN of the process. The low int of the PSN should be at 'kPSNLoOffset',
and the high int at 'kPSNHiOffset' |
static int launchURL(String url,
int flags,
String[] preferredBrowsers)
Launches the given URL.
Parameter | Description |
url | the fully qualified URL |
flags | currently ignored |
preferredBrowsers | currently ignored |
static int getFileDate(int vRef,
int parID,
byte[] pName,
int[] datesArray)
Get the dates of a file into an array of ints
WANC
Parameter | Description |
datesArray | the three dates for the file are placed in this array, in the order:
modification, creation, backup |
static int setFileDate(int vRef,
int parID,
byte[] pName,
int[] datesArray)
Set the dates of a file from an array of ints
WANC
Parameter | Description |
datesArray | the three dates for the file should be placed in this array, in the order:
modification, creation, backup |
static int getVolumeDate(int vRef,
int[] datesArray)
Get the dates of a volume into an array of ints
WANC
Parameter | Description |
datesArray | the three dates for the volume are placed in this array, in the order:
modification, creation, backup |
static int setVolumeDate(int vRef,
int[] datesArray)
Set the dates of a volume from an array of ints
WANC
Parameter | Description |
datesArray | the three dates for the volume should be placed in this array, in the order:
modification, creation, backup |
static int getOpenableFileTypes(int vRef,
int creator,
int[] numReturned,
int[] fileTypes)
WANC
static int getRawResourceFork(int flags,
int vRef,
int parID,
byte[] pName,
byte[] data)
WANC
static int setRawResourceFork(int flags,
int vRef,
int parID,
byte[] pName,
byte[] data)
WANC
static int setForkLength(int flags,
int whichFork,
int vRef,
int parID,
byte[] pName,
long newLen)
WANC
private static int wrap_nGetRawResourceFork(int flags,
int vRef,
int parID,
byte[] pName,
byte[] data)
private static int wrap_nSetRawResourceFork(int flags,
int vRef,
int parID,
byte[] pName,
byte[] data)
private static int wrap_nSetForkLength(int flags,
int whichFork,
int vRef,
int parID,
byte[] pName,
long newLen)
private static int wrap_nSendAppDocs(int whichCommand,
int[] appPSN,
String[] filePaths,
int flags)
private static int wrap_nQuitApp(int[] appPSN,
int flags)
private static int wrap_nLaunchApp(int vRef,
int parID,
byte[] pName,
int[] retPSN,
int flags)
private static int wrap_nLaunchWithDoc(int whichCommand,
int vRef,
int parID,
byte[] pName,
String[] filePaths,
int[] retPSN,
int flags)
private static int wrap_nCreateFullPathName(int vRef,
int parID,
byte[] pName,
String[] retArray)
private static int wrap_nGetOpenableFileTypes(int vRef,
int creator,
int[] numReturned,
int[] fileTypes)
private static int wrap_nGetFileDate(int unused,
int vRef,
int parID,
byte[] pName,
int[] datesArray)
private static int wrap_nSetFileDate(int unused,
int vRef,
int parID,
byte[] pName,
int[] datesArray)
private static int wrap_nGetVolumeDate(int unused,
int vRef,
int[] datesArray)
private static int wrap_nSetVolumeDate(int unused,
int vRef,
int[] datesArray)
private static int wrap_nVerifyPSN(int[] appPSN)
private static int wrap_nMoveApp(int[] appPSN,
int selector,
int flags)
private static int wrap_nLaunchURLDirect(String url,
int flags,
String[] preferredBrowsers)
private static int wrap_nFullPathToSpec(String fullPath,
int[] vRefAndParID,
byte[] pName)
private static int wrap_nGetFinderInfo(int vRef,
int parID,
byte[] pName,
int[] finfo)
private static int wrap_nSetCreatorAndType(int vRef,
int parID,
byte[] pName,
int[] creatorAndType)
private static int wrap_nVerifyFile(int vRef,
int parID,
byte[] pName)
private static int wrap_nVerifyVolume(int vRef)
private static int wrap_nGetDiskFileFlags(int vRef,
int parID,
byte[] pName,
int[] flags)
private static int wrap_nSetDiskFileFlags(int vRef,
int parID,
byte[] pName,
int flagMask,
int newFlags)
private static int wrap_nGetDFWriteFlagsMask(int vRef,
int parID,
byte[] pName,
int[] masks)
private static int wrap_nGetDFReadFlagsMask(int vRef,
int parID,
byte[] pName,
int[] masks)
private static int wrap_nGetDiskVolumeFlags(int vRef,
int[] flags)
private static int wrap_nSetDiskVolumeFlags(int vRef,
int flagMask,
int newFlags)
private static int wrap_nGetDVReadFlagsMask(int vRef,
int[] masks)
private static int wrap_nGetDVWriteFlagsMask(int vRef,
int[] masks)
private static int wrap_nGetVolumes(int maxToReturn,
int[] numRet,
int[] vRefs)
private static int wrap_nUpdateContainer(int vRef,
int parID,
byte[] pName)
private static int wrap_nGetFileCategory(int vRef,
int parID,
byte[] pName,
int[] cat)
private static int wrap_nGetForkSizes(int vRef,
int parID,
byte[] pName,
long[] len)
private static int wrap_nRenameFile(int vRef,
int parID,
byte[] pName,
byte[] pOutName,
String newName)
private static int wrap_nRenameVolume(int vRef,
String newName)
private static int wrap_nGetVolumeCapacity(int vRef,
long[] cap)
private static int wrap_nGetVolumeFreeSpace(int vRef,
long[] space)
private static int wrap_nCreateAlias(int vRef,
int parID,
byte[] pName,
String newAlias,
int creator,
int flags)
private static int wrap_nGetVolumeName(int vRef,
byte[] pName)
private static int wrap_nResolveAlias(int inVRef,
int inParID,
byte[] pInName,
int[] outVRefAndParID,
byte[] pOutName,
int flags)
private static int wrap_nSetColorCoding(int vRef,
int parID,
byte[] pName,
int newCoding)
private static int wrap_nSetVolumeColorCoding(int vRef,
int newCoding)
private static int wrap_nGetVolumeFinderInfo(int vRef,
int[] finfo)
private static int wrap_nGetVolumeIconSuite(int vRef,
int selector,
int[] pHSuite)
private static int wrap_nGetFileIconSuite(int vRef,
int parID,
byte[] pName,
int selector,
int[] pHSuite)
private static int wrap_nGetFTACIconSuite(int vRef,
int creator,
int type,
int selector,
int[] pHSuite)
private static int wrap_nPlotIcon(int which,
int width,
int height,
int hSuite,
int xform,
int align,
int[] pData)
private static int wrap_nCreateVolumeAlias(int targetVRef,
String newAlias,
int creator,
int flags)
private static int wrap_nIterateContents(int vRef,
int parID,
byte[] pName,
int[] dirIDArray,
int[] numRet,
byte[] buffer,
int numEntries,
int flags)
private static int wrap_nIVC(int vRef,
int[] dirIDArray,
int[] numRet,
byte[] buffer,
int numEntries,
int flags)
private static int wrap_nGetContainer(int vRef,
int parID,
byte[] pName,
int[] pContParID,
byte[] pContName)
private static int wrap_nDisposeIconSuite(int hSuite,
int flags)
private static int wrap_nGetAllMonitorInfo(int[] monitorInfo,
int maxToReturn,
int[] numReturned)
private static int wrap_nGetMainMonitorInfo(int[] monitorInfo)
private static int wrap_nGetProcesses(int maxToReturn,
int flags,
int[] numRet,
int[] vRefs,
int[] parIDs,
byte[] pNames,
int[] psnLo,
int[] psnHi,
int[] proFlags)
private static native int nGetRawResourceFork(int flags,
int vRef,
int parID,
byte[] pName,
byte[] data)
private static native int nSetRawResourceFork(int flags,
int vRef,
int parID,
byte[] pName,
byte[] data)
private static native int nSetForkLength(int flags,
int whichFork,
int vRef,
int parID,
byte[] pName,
long newLen)
private static native int nSendAppDocs(int whichCommand,
int[] appPSN,
String[] filePaths,
int flags)
private static native int nQuitApp(int[] appPSN,
int flags)
private static native int nLaunchApp(int vRef,
int parID,
byte[] pName,
int[] retPSN,
int flags)
private static native int nLaunchWithDoc(int whichCommand,
int vRef,
int parID,
byte[] pName,
String[] filePaths,
int[] retPSN,
int flags)
private static native int nCreateFullPathName(int vRef,
int parID,
byte[] pName,
String[] retArray)
private static native int nGetOpenableFileTypes(int vRef,
int creator,
int[] numReturned,
int[] fileTypes)
private static native int nGetFileDate(int unused,
int vRef,
int parID,
byte[] pName,
int[] datesArray)
Called by getFileDate
Parameter | Description |
unused | no longer used, set to 0
all three dates for the file are placed in the 'datesArray' argument, in the order:
modification, creation, backup |
private static native int nSetFileDate(int unused,
int vRef,
int parID,
byte[] pName,
int[] datesArray)
Called by xetFileDate
Parameter | Description |
unused | no longer used, set to 0
all three dates for the file should be placed in the 'datesArray' argument, in the order:
modification, creation, backup |
private static native int nGetVolumeDate(int unused,
int vRef,
int[] datesArray)
Called by getVolumeDate
Parameter | Description |
unused | no longer used, set to 0
all three dates for the volume are placed in the 'datesArray' argument, in the order:
modification, creation, backup |
private static native int nSetVolumeDate(int unused,
int vRef,
int[] datesArray)
Called by setVolumeDate
Parameter | Description |
unused | no longer used, set to 0
all three dates for the volume should be placed in the 'datesArray' argument, in the order:
modification, creation, backup |
private static native int nVerifyPSN(int[] appPSN)
private static native int nMoveApp(int[] appPSN,
int selector,
int flags)
private static native int nLaunchURLDirect(String url,
int flags,
String[] preferredBrowsers)
private static native int nFullPathToSpec(String fullPath,
int[] vRefAndParID,
byte[] pName)
private static native int nGetFinderInfo(int vRef,
int parID,
byte[] pName,
int[] finfo)
private static native int n(int vRef,
int parID,
byte[] pName,
int[] creatorAndType)
private static native int nVerifyFile(int vRef,
int parID,
byte[] pName)
private static native int nVerifyVolume(int vRef)
private static native int nGetDiskFileFlags(int vRef,
int parID,
byte[] pName,
int[] flags)
private static native int nSetDiskFileFlags(int vRef,
int parID,
byte[] pName,
int flagMask,
int newFlags)
private static native int nGetDFWriteFlagsMask(int vRef,
int parID,
byte[] pName,
int[] masks)
private static native int nGetDFReadFlagsMask(int vRef,
int parID,
byte[] pName,
int[] masks)
private static native int nGetDiskVolumeFlags(int vRef,
int[] flags)
private static native int nSetDiskVolumeFlags(int vRef,
int flagMask,
int newFlags)
private static native int nGetDVReadFlagsMask(int vRef,
int[] masks)
private static native int nGetDVWriteFlagsMask(int vRef,
int[] masks)
private static native int nGetVolumes(int maxToReturn,
int[] numRet,
int[] vRefs)
private static native int nUpdateContainer(int vRef,
int parID,
byte[] pName)
private static native int nGetFileCategory(int vRef,
int parID,
byte[] pName,
int[] cat)
private static native int nGetForkSizes(int vRef,
int parID,
byte[] pName,
long[] len)
private static native int nRenameFile(int vRef,
int parID,
byte[] pName,
byte[] pOutName,
String newName)
private static native int nRenameVolume(int vRef,
String newName)
private static native int nGetVolumeCapacity(int vRef,
long[] cap)
private static native int nGetVolumeFreeSpace(int vRef,
long[] space)
private static native int nCreateAlias(int vRef,
int parID,
byte[] pName,
String newAlias,
int creator,
int flags)
private static native int nGetVolumeName(int vRef,
byte[] pName)
private static native int nResolveAlias(int inVRef,
int inParID,
byte[] pInName,
int[] outVRefAndParID,
byte[] pOutName,
int flags)
private static native int nSetColorCoding(int vRef,
int parID,
byte[] pName,
int newCoding)
private static native int nSetVolumeColorCoding(int vRef,
int newCoding)
private static native int nGetVolumeFinderInfo(int vRef,
int[] finfo)
private static native int nGetVolumeIconSuite(int vRef,
int selector,
int[] pHSuite)
private static native int nGetFileIconSuite(int vRef,
int parID,
byte[] pName,
int selector,
int[] pHSuite)
private static native int nGetFTACIconSuite(int vRef,
int creator,
int type,
int selector,
int[] pHSuite)
private static native int nPlotIcon(int which,
int width,
int height,
int hSuite,
int xform,
int align,
int[] pData)
private static native int nCreateVolumeAlias(int targetVRef,
String newAlias,
int creator,
int flags)
private static native int nIterateContents(int vRef,
int parID,
byte[] pName,
int[] dirIDArray,
int[] numRet,
byte[] buffer,
int numEntries,
int flags)
private static native int nIVC(int vRef,
int[] dirIDArray,
int[] numRet,
byte[] buffer,
int numEntries,
int flags)
private static native int nGetContainer(int vRef,
int parID,
byte[] pName,
int[] pContParID,
byte[] pContName)
private static native int nDisposeIconSuite(int hSuite,
int flags)
private static native int nGetAllMonitorInfo(int[] monitorInfo,
int maxToReturn,
int[] numReturned)
private static native int nGetMainMonitorInfo(int[] monitorInfo)
private static native int nGetProcesses(int maxToReturn,
int flags,
int[] numRet,
int[] vRefs,
int[] parIDs,
byte[] pNames,
int[] psnLo,
int[] psnHi,
int[] proFlags)
private static native int nSetCreatorAndType(int vRef,
int parID,
byte[] pName,
int[] creatorAndType)
static void testLink()
Calls each of the native methods with invalid arguments. Used to test if there are link problems.
All Packages This Package Class Hierarchy Class Search Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7