>
> Hi
> as far as I can see currently
> jmol supports only predefined list of the protocols:
>
> form FileManager source:
>
> final String[] urlPrefixes = {"http:", "https:", "ftp:", "file:"};
>
> and it's used in the classifyName method
>
> for (int i = 0; i < urlPrefixes.length; ++i) {
> .....
> }
>
> so if we want to use our custom protocol
custom protocol : internet/open source :: oil : water
I am puzzled ... I don't know what your application is, but help me
understand what are the benefits of using a custom protocol.
> there is no way as to handle
> it by ourself and use loading model from the string
> that's wasting memory I think (especially if models are huge)
Maybe. But it probably won't make any measurable difference. You are
already network bandwidth limited and file parsing is already incredibly
inefficient.
> I would like to have more flexible scheme
> when user can add/remove desirable protocols (urlPrefixes)
>
> I don't think it's a big deal to do
> with your permission I can do that
>
> currently I have to do something like that:
>
> public synchronized void loadMolecule(URL url){
> ....
> String urlString = url.toExternalForm();
> boolean isCCProtocols = isURLCCProtocols(urlString);
> if(isCCProtocols){
> loadFileFromCCProtocols(urlString);
> }else{
> jMolViewer.openFile(urlString);
> lastError = jMolViewer.getOpenFileError();
> }
> .....
> }
> BTW, that's why I can not use script command to load our files
This seems to me to be a bigger problem than simply allowing additional
string prefixes.
Q: Can the Java class library deal with this custom protocol?
Q: Where is the driver code?
Miguel
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers