Skip to main content

Filetypes API

3 replies [Last post]
yeroc
Offline
Joined: 2003-06-10
Points: 0

I was just looking over the filetypes API and reading the notes and I was wondering if it wouldn't make better sense to have the AssociationService.registerSystemAssociation() & registerUserAssociation() methods throw a SecurityException (or a sub-class thereof) in the case where the user does not have the required level of access instead of just throwing a RegisterFailedException.

Would it be possible to integrate with the SecurityManager architecture? This would allow the application developer to determine ahead of time via checkPermission() whether the user is allowed to set the filetype etc.

Corey

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anonymous

Hi Corey

I don't think it's quite possible to do this on Windows platform as I don't think we could use checkPermission() to check if a user could register a filetype system wide.

What's your idea?

-Paul

yeroc
Offline
Joined: 2003-06-10
Points: 0

If that's not possible I guess you could attempt to write & delete a dummy key into the appropriate place in the registry to test. At any rate even if that's not possible under Windows could the AssociationService.registerSystemAssociation() & registerUserAssociation() still throw a SecurityException? (This question is really independant of the question of whether to integrate with the SecurityManager framework or not.) On platforms where you can't determine either before or after that the association failed due to lack of permissions you just never throw a SecurityException. On platforms where the determination is possible throw it.

Integration with the SecurityManager would also give the user control with explicit high-level grants on whether an application should have the ability to set file associations independant of the underlying OS.

Paul Huang
Offline
Joined: 2006-02-17
Points: 0

Hi Yeroc

Thanks for your suggestion. We will look into this and get you back ASAP.

-Paul