Mailing Lists: Apple Mailing Lists

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

Re: When is a File not a File?




On 10-Jun-05, at 1:15 PM, Ian Cheyne wrote:

Answer: When its actually a Directory.

In this case when it's a bundle. The easiest course is to use NSBundle to access the bundle. For a Keynote bundle called "FeatureSummary.key":



import com.apple.cocoa.foundation.*; import com.apple.cocoa.application.*;


NSBundle keynoteBundle = NSBundle.bundleWithPath ("FeatureSummary.pages");


System.out.println("Keynote bundle is "+keynoteBundle);

NSDictionary info = keynoteBundle.infoDictionary();
System.out.println("Info is "+ info);

NSArray resources = keynoteBundle.pathsForResources(null, keynoteBundle.bundlePath());
System.out.println("Bundle resources :"+ resources);





Note: NSBundle.bundleWithPath() will return null if the path-string isn't a bundle.




NSBundle
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ Java/Classes/NSBundle.html#//apple_ref/doc/uid/20000322-BCIBBIGC



Rob

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >When is a File not a File? (From: Ian Cheyne <email@hidden>)



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.