Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: file selection criteria
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file selection criteria



On Wed, 15 Jun 2005, Alex Shaykevich wrote:

Without opening the file, one(only??) way is to go by
file type extensions comparing them to those that QT
supports for that type, video, image, etc...

This function gives you back a list of supported
extensions you can compare against your own file
types.  For instance, if you pass in
StdQTConstants.graphicsImporterComponentType, you'll
get the list of image extensions supported by the
system by QT.

   public static ArrayList getSupportedExtensions(int
type) throws QTException {

  ArrayList list = new ArrayList();

  ComponentDescription wildcard =
      new ComponentDescription(type);
  ComponentIdentifier ci = null;
  while ( (ci = ComponentIdentifier.find(ci,
wildcard)) != null) {
     ComponentDescription cd = ci.getInfo();

     list.add(QTUtils.fromOSType(cd.getSubType()));
  }

  return list;
}


Thanks for you comments Alex, and especially your sample code -- it looked simple to me at first, but after copyoing it into my app I realized that the java docs really don't explain this at all -- I doubt I could have come up with it myself without hours of crossreferencing the javadocs and the quicktime documentation!

You implied in your message that there was no way to really tell without opeing it, so, in the end, I've taken the approach of letting the user import whatever file they want and then giving them an error message if it didn't work out.

That said, I've kept your code in my source commented in case I change my mind! Thanks again!

        bjorn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: file selection criteria (From: Alex Shaykevich <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.