|
Quaqua 8.0 2011-10-02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.randelshofer.quaqua.osx.OSXFile
public class OSXFile
OSXFile
provides access to Mac OS X file meta data and can resolve
file aliases.
Field Summary | |
---|---|
static int |
FILE_TYPE_ALIAS
|
static int |
FILE_TYPE_DIRECTORY
|
static int |
FILE_TYPE_FILE
|
static int |
FILE_TYPE_UNKOWN
|
Method Summary | |
---|---|
static boolean |
canWorkWithAliases()
Returns true if this class can work with aliases. |
static boolean |
canWorkWithLabels()
Returns true if this class can work with labels. |
static java.io.File |
getAbsoluteFile(java.io.File f)
Converts the path name denoted by the file to an absolute path. |
static java.lang.String |
getDisplayName(java.io.File f)
Returns the localized display name of the specified file. |
static int |
getFileType(java.io.File f)
Returns the file type: 0=file, 1=directory, 2=alias, -1=unknown. |
static javax.swing.Icon |
getIcon(java.io.File file,
int size)
Returns the icon for the specified file. |
static java.awt.image.BufferedImage |
getIconImage(java.io.File file,
int size)
Returns the icon image for the specified file. |
static java.lang.String |
getKindString(java.io.File file)
Returns the kind string of the specified file. |
static int |
getLabel(java.io.File f)
Returns the label of the specified file. |
static java.awt.Color |
getLabelColor(int label,
int type)
Returns the color of the specified label. |
static javax.swing.Icon |
getQuickLookThumbnail(java.io.File file,
int size)
Returns a QuickLook thumbnail for the specified file. |
static java.awt.image.BufferedImage |
getQuickLookThumbnailImage(java.io.File file,
int size)
Returns the QuickLook thumbnail image for the specified file. |
static boolean |
isTraversable(java.io.File file)
|
static java.io.File |
resolveAlias(byte[] serializedAlias,
boolean noUI)
Resolves a serialized Alias to a File object. |
static java.io.File |
resolveAlias(java.io.File alias,
boolean noUI)
Resolves an alias to a File object. |
static int |
resolveAliasType(byte[] serializedAlias,
boolean noUI)
Resolves an alias to a type info. |
static int |
resolveAliasType(java.io.File alias,
boolean noUI)
Resolves an alias to a type info. |
static byte[] |
toSerializedAlias(java.io.File f)
Creates a serialized Alias. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FILE_TYPE_ALIAS
public static final int FILE_TYPE_DIRECTORY
public static final int FILE_TYPE_FILE
public static final int FILE_TYPE_UNKOWN
Method Detail |
---|
public static java.io.File getAbsoluteFile(java.io.File f)
f
- The file which we must ensure contains an absolute path.public static boolean canWorkWithAliases()
public static int getFileType(java.io.File f)
public static java.io.File resolveAlias(java.io.File alias, boolean noUI)
alias
- the Alias file to be resolved.noUI
- Set this to true, if the alias should
be resolved without user interaction.
public static int resolveAliasType(java.io.File alias, boolean noUI)
alias
- the path to the alias to be resolved.noUI
- Set this to true, if the alias should
be resolved without user interaction.
public static byte[] toSerializedAlias(java.io.File f)
public static java.io.File resolveAlias(byte[] serializedAlias, boolean noUI)
noUI
- Set this to true, if the alias should
be resolved without user interaction.
public static int resolveAliasType(byte[] serializedAlias, boolean noUI)
serializedAlias
- the path to the alias to be resolved.noUI
- Set this to true, if the alias should
be resolved without user interaction.
public static boolean canWorkWithLabels()
public static int getLabel(java.io.File f)
public static java.awt.Color getLabelColor(int label, int type)
label
- value from 0 through 7type
- 0=dark enabled,1=bright enabld,2=dark disabled,3=bright enabledpublic static java.awt.image.BufferedImage getIconImage(java.io.File file, int size)
public static java.awt.image.BufferedImage getQuickLookThumbnailImage(java.io.File file, int size)
Please only call this method on Mac OS X 10.6 Snow Leopard and above. Altough the native API is also present on Mac OS X 10.5 our code does not run stable there.
public static javax.swing.Icon getIcon(java.io.File file, int size)
public static javax.swing.Icon getQuickLookThumbnail(java.io.File file, int size)
public static java.lang.String getKindString(java.io.File file)
public static boolean isTraversable(java.io.File file)
public static java.lang.String getDisplayName(java.io.File f)
|
Copyright 2003-2007 (c) Werner Randelshofer. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |