Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

alias files, symbolic links



I'm working on a Cocoa-Java app that currently uses an AppleScript to
do the core of its work, hammering the Finder with AppleEvents for 30
seconds or more. Unfortunately, I'm experiencing flakiness with AEs
to the Finder. Sometimes they just hang and the Finder has to be
relaunched.

Clearly it would be more reliable and a lot faster to use file system
calls to do most of the work, and to send AEs to the Finder only for
things that need to be done in its UI.

Does anyone know of any code that can be pressed into use to
implement the below? Would anyone like to implement it for a fee?
I've got too much else to do to focus on this right now.

Thanks

Dave


import java.io.*;

/**
* A MacFile is just a File that provides some Mac-specific and
unix-specific methods.
*/
public class MacFile extends File {

public MacFile(String path) {
super(path);
}

/**
* Makes a MacFile from a File.
*
* @param file the file to make into a MacFile
* @return the new MacFile
*/
public static MacFile makeMacFile(File file) {
return new MacFile(file.getPath());
}

/**
* Returns true if this is an alias file.
*
* @return true if this is an alias file
*/
public boolean isAliasFile() {
return false;
}

/**
* Finds the MacFile referred to by this File.
*
* @return the MacFile referred to or null if it's not there
*/
public MacFile aliasReferent() {
return null;
}

/**
* Makes a new alias file pointing to to this File.
* If the aliasPath argument is a directory,
* then the new alias will be in that directory with the same
name as this File.
*
* @param aliasPath the path for the new MacFile or the path
* to the directory where it is to be created
* @return a new MacFile for the alias created
*/
public MacFile newAlias(File aliasPath) {
return null;
}


/**
* Returns true if this is a symbolic link.
*
* @return true if symbolic link
*/
public boolean isSymbolicLink() {
return false;
}

/**
* Returns a MacFile representing the path referred to by this File,
* whether anything is there or not.
*
* @return the MacFile referred to
*/
public MacFile symbolicLinkReferent() {
return null;
}

/**
* Makes a symbolic link pointing to to this.
* If the symbolicLinkPath argument is a directory,
* then the new symbolic link will be in that directory with the
same name as this.
*
* @param symbolicLinkPath the path for the new MacFile or the path
* to the directory where it is to be created
* @return a new MacFile for the alias created
*/
public MacFile newSymbolicLink(File symbolicLinkPath) {
return null;
}

}
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.