|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
password protected filesHi, I was wondering if there's any way to identify password protected files before opening it? It doesn't seem to throw an aIOException or illegalArgumentException. It just seems to fail XComponent.is(). The thing is that this could fail due to other reasons. Cheers, Wei Min _________________________________________________________________ New Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop |
|
|
Re: password protected filesHi Wei Min,
it depends from the API you are using. I suspect that you are using loadComponentFromURL(), in this case you can provide the InteractionHandler in the MediaDescriptor, the InteractionHandler would handle the document password request in this case. If the standard InteractionHandler implementation is provided to the call, the password dialog would be shown to user. You can also provide an own simple InteractionHandler implementation, that could for example detect whether document password request was done on loading ( that means that the document is encrypted one ). In the same way other problems during the loading could be handled. Hope that helps. Best regards, Mikhail. On 11/04/09 11:05, Wei Min Teo wrote: > Hi, > > > > I was wondering if there's any way to identify password protected files before opening it? > > > > It doesn't seem to throw an aIOException or illegalArgumentException. It just seems to fail XComponent.is(). The thing is that this could fail due to other reasons. > > > > > > > > > > Cheers, > > > > Wei Min > > > > > > _________________________________________________________________ > New Windows 7: Find the right PC for you. Learn more. > http://windows.microsoft.com/shop > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
RE: password protected filesHi Mikhail, Thanks for the reply. You're right, i'm using loadComponentFromURL(). How can i code a simple interactionhandler to detect the password event? If this is the only case i implement the interactionhandler to handle, will all other cases run through the default interactionhandler to throw the default exceptions? Thanks. Cheers, Wei Min > Date: Wed, 4 Nov 2009 13:15:14 +0100 > From: Mikhail.Voytenko@... > To: dev@... > Subject: Re: [api-dev] password protected files > > Hi Wei Min, > > it depends from the API you are using. > > I suspect that you are using loadComponentFromURL(), in this case you > can provide the InteractionHandler in the MediaDescriptor, the > InteractionHandler would handle the document password request in this case. > > If the standard InteractionHandler implementation is provided to the > call, the password dialog would be shown to user. You can also provide > an own simple InteractionHandler implementation, that could for example > detect whether document password request was done on loading ( that > means that the document is encrypted one ). In the same way other > problems during the loading could be handled. > > Hope that helps. > > Best regards, > Mikhail. > > > On 11/04/09 11:05, Wei Min Teo wrote: > > Hi, > > > > > > > > I was wondering if there's any way to identify password protected files before opening it? > > > > > > > > It doesn't seem to throw an aIOException or illegalArgumentException. It just seems to fail XComponent.is(). The thing is that this could fail due to other reasons. > > > > > > > > > > > > > > > > > > > > Cheers, > > > > > > > > Wei Min > > > > > > > > > > > > _________________________________________________________________ > > New Windows 7: Find the right PC for you. Learn more. > > http://windows.microsoft.com/shop > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@... > For additional commands, e-mail: dev-help@... > _________________________________________________________________ New Windows 7: Find the right PC for you. Learn more. http://windows.microsoft.com/shop |
|
|
Re: password protected filesHi Wei Min,
On 11/05/09 03:22, Wei Min Teo wrote: > Hi Mikhail, > > > > Thanks for the reply. You're right, i'm using loadComponentFromURL(). > > > > How can i code a simple interactionhandler to detect the password event? The InteractionHandler argument is mentioned in the following article: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Handling_Documents As it is mentioned there you should just implement the com.sun.star.task.InteractionHandler service. http://api.openoffice.org/docs/common/ref/com/sun/star/task/InteractionHandler.html > > If this is the only case i implement the interactionhandler to handle, will all other cases run through the default interactionhandler to throw the default exceptions? > Please see the following sourcecode as an example of a simple InteractionHandler that does not show any UI. http://svn.services.openoffice.org/opengrok/xref/DEV300_m60/framework/source/interaction/quietinteraction.cxx Your implementation could look similar and additionally it could remember whether com.sun.star.task.DocumentPasswordRequest was done. This request is done in case an encrypted document is loaded to get the password. Hope that helps. Best regards, Mikhail. > > > Thanks. > > > > Cheers, > > > > Wei Min > >> Date: Wed, 4 Nov 2009 13:15:14 +0100 >> From: Mikhail.Voytenko@... >> To: dev@... >> Subject: Re: [api-dev] password protected files >> >> Hi Wei Min, >> >> it depends from the API you are using. >> >> I suspect that you are using loadComponentFromURL(), in this case you >> can provide the InteractionHandler in the MediaDescriptor, the >> InteractionHandler would handle the document password request in this case. >> >> If the standard InteractionHandler implementation is provided to the >> call, the password dialog would be shown to user. You can also provide >> an own simple InteractionHandler implementation, that could for example >> detect whether document password request was done on loading ( that >> means that the document is encrypted one ). In the same way other >> problems during the loading could be handled. >> >> Hope that helps. >> >> Best regards, >> Mikhail. >> >> >> On 11/04/09 11:05, Wei Min Teo wrote: >>> Hi, >>> >>> >>> >>> I was wondering if there's any way to identify password protected files before opening it? >>> >>> >>> >>> It doesn't seem to throw an aIOException or illegalArgumentException. It just seems to fail XComponent.is(). The thing is that this could fail due to other reasons. >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Cheers, >>> >>> >>> >>> Wei Min >>> >>> >>> >>> >>> >>> _________________________________________________________________ >>> New Windows 7: Find the right PC for you. Learn more. >>> http://windows.microsoft.com/shop >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@... >> For additional commands, e-mail: dev-help@... >> > > _________________________________________________________________ > New Windows 7: Find the right PC for you. Learn more. > http://windows.microsoft.com/shop > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
| Free embeddable forum powered by Nabble | Forum Help |