|
|
|
|
|
Re: Exchange the InputStream [message #925444 is a reply to message #925379] |
Thu, 27 September 2012 18:18 |
Henrik Lindberg Messages: 2509 Registered: July 2009 |
Senior Member |
|
|
On 2012-27-09 10:05, Moritz Höser wrote:
> Great, I think the EFS is exactly what I was looking for, thank you.
>
> I wrote a FileStore for this purpose (providing a custom InputStream),
> but I don't know how to register it properly. If I use a new FileSystem,
> it will only be activated when the file uri has a special scheme. I want
> to use the "file:" scheme, so that a simple double click opens an editor
> with the decrypted file, as you suggested.
>
> In case someone is looking for a solution, I opened
> http://www.eclipse.org/forums/index.php/t/386177/ since this is not
> directly Xtext
>
> Henrik Lindberg wrote on Thu, 27 September 2012 01:19
>> Sounds like you want to cut into the process where an IResource is
>> being read. I wonder if it would perhaps best be implemented as an
>> Eclipse File System where files can be encrypted. That would make it
>> completely transparent to all upper layers. This way even a simple
>> text editor could open an encrypted file.
>
>
Replace the file scheme with a delegating scheme ?
- henrik
|
|
|
Re: Exchange the InputStream [message #925732 is a reply to message #925444] |
Fri, 28 September 2012 01:27 |
Moritz Höser Messages: 11 Registered: September 2012 |
Junior Member |
|
|
I think you suggest to change the files locationUri. This may be possible for single files if done by hand, but to keep track of all the ways a file can be created and change its uri programmatically seems like an awful lot of work to me.. And when the root folder of a file is a linked, non-virtual folder, its not possible to change the file scheme. So if I see it right, when one want to use the standard Project Explorer and so on, a custom FileStore must be provided with the "file" filesystem (aka LocalFileSystem).
To see if it works, I registered a FileSystem to the scheme "file" which provides FileStores that are fully compatible with the usually ones but open special InputStreams for the encrypted file types. This works, Xtext loads the encypted files and displays the decrypted text, and saves the text encrypted again without any other modifications. But it is rather ugly, since having a second "file" FileSystem is not intended.
I will try to work with a special charset / Encoding instead.
If someone has any other ideas or remarks, please let me know.
Henrik Lindberg wrote on Thu, 27 September 2012 14:18Replace the file scheme with a delegating scheme ?
- henrik
Thank you for your help Henrik.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02852 seconds