You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Anselm Kruis (JIRA)" <ji...@apache.org> on 2007/01/20 00:53:29 UTC

[jira] Created: (CONFIGURATION-249) save to URLs with a protocol other than "file:"

save to URLs with a protocol other than "file:"
-----------------------------------------------

                 Key: CONFIGURATION-249
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-249
             Project: Commons Configuration
          Issue Type: Improvement
    Affects Versions: 1.4
            Reporter: Anselm Kruis
            Priority: Minor
             Fix For: 1.4


Currently, the save(URL) method from AbstractFileConfiguration only supports "file:" URLs. 
Why not support  writing to URLs too? It is as simple like this

				java.net.URLConnection connection = url.openConnection();
				connection.setDoOutput(true);
				connection.setDoInput(false);
				save(connection.getOutputStream());

I could prepare a patch.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (CONFIGURATION-249) save to URLs with a protocol other than "file:"

Posted by "Emmanuel Bourg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488818 ] 

Emmanuel Bourg commented on CONFIGURATION-249:
----------------------------------------------

Just curious, why do you want to save to a non file URL ? To write the configuration on a FTP server ?

> save to URLs with a protocol other than "file:"
> -----------------------------------------------
>
>                 Key: CONFIGURATION-249
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-249
>             Project: Commons Configuration
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Anselm Kruis
>            Priority: Minor
>             Fix For: 1.5
>
>
> Currently, the save(URL) method from AbstractFileConfiguration only supports "file:" URLs. 
> Why not support  writing to URLs too? It is as simple like this
> 				java.net.URLConnection connection = url.openConnection();
> 				connection.setDoOutput(true);
> 				connection.setDoInput(false);
> 				save(connection.getOutputStream());
> I could prepare a patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (CONFIGURATION-249) save to URLs with a protocol other than "file:"

Posted by "Emmanuel Bourg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489044 ] 

Emmanuel Bourg commented on CONFIGURATION-249:
----------------------------------------------

Thank you Anselm, I'll try to build a test case with a FTP server.

> save to URLs with a protocol other than "file:"
> -----------------------------------------------
>
>                 Key: CONFIGURATION-249
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-249
>             Project: Commons Configuration
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Anselm Kruis
>            Priority: Minor
>             Fix For: 1.5
>
>
> Currently, the save(URL) method from AbstractFileConfiguration only supports "file:" URLs. 
> Why not support  writing to URLs too? It is as simple like this
> 				java.net.URLConnection connection = url.openConnection();
> 				connection.setDoOutput(true);
> 				connection.setDoInput(false);
> 				save(connection.getOutputStream());
> I could prepare a patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (CONFIGURATION-249) save to URLs with a protocol other than "file:"

Posted by "Anselm Kruis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489027 ] 

Anselm Kruis commented on CONFIGURATION-249:
--------------------------------------------

Hi Emmanuel,

Besides plain "file:"-URLs, I'll write to a "fgfile:"-URL. Unfortunately,
fgfile is an URL schema specific to a closed source product: flowGuide
from science+computing.  The fgfile-URL is an extention to the usual file
URL, that adds some metadata about the file.

But it is also possible to write to ftp or http or any other writable
schema you plug into the java runtime. Of course this makes testing the
non "file:" case a little bit complicated:  you need a suitable ftp or
http server first, or you need your own URL-handler classes.

Best Regards
  Anselm



---
 Dipl. Phys. Anselm Kruis                       science + computing ag
 Senior Solutions Engineer                      Ingolst�dter Str. 22
 email A.Kruis@science-computing.de             80807 M�nchen, Germany
 phone +49 89 356386 874                        www.science-computing.de
 fax   +49 89 356386 737


> save to URLs with a protocol other than "file:"
> -----------------------------------------------
>
>                 Key: CONFIGURATION-249
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-249
>             Project: Commons Configuration
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Anselm Kruis
>            Priority: Minor
>             Fix For: 1.5
>
>
> Currently, the save(URL) method from AbstractFileConfiguration only supports "file:" URLs. 
> Why not support  writing to URLs too? It is as simple like this
> 				java.net.URLConnection connection = url.openConnection();
> 				connection.setDoOutput(true);
> 				connection.setDoInput(false);
> 				save(connection.getOutputStream());
> I could prepare a patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Resolved: (CONFIGURATION-249) save to URLs with a protocol other than "file:"

Posted by "Emmanuel Bourg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bourg resolved CONFIGURATION-249.
------------------------------------------

    Resolution: Fixed

The fix is now fully tested

> save to URLs with a protocol other than "file:"
> -----------------------------------------------
>
>                 Key: CONFIGURATION-249
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-249
>             Project: Commons Configuration
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Anselm Kruis
>         Assigned To: Emmanuel Bourg
>            Priority: Minor
>             Fix For: 1.5
>
>
> Currently, the save(URL) method from AbstractFileConfiguration only supports "file:" URLs. 
> Why not support  writing to URLs too? It is as simple like this
> 				java.net.URLConnection connection = url.openConnection();
> 				connection.setDoOutput(true);
> 				connection.setDoInput(false);
> 				save(connection.getOutputStream());
> I could prepare a patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (CONFIGURATION-249) save to URLs with a protocol other than "file:"

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466267 ] 

Oliver Heger commented on CONFIGURATION-249:
--------------------------------------------

A patch would be highly appreciated. If you could provide a unit test for the new feature, too, this would be even better.

Thank you very much.

> save to URLs with a protocol other than "file:"
> -----------------------------------------------
>
>                 Key: CONFIGURATION-249
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-249
>             Project: Commons Configuration
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Anselm Kruis
>            Priority: Minor
>             Fix For: 1.4
>
>
> Currently, the save(URL) method from AbstractFileConfiguration only supports "file:" URLs. 
> Why not support  writing to URLs too? It is as simple like this
> 				java.net.URLConnection connection = url.openConnection();
> 				connection.setDoOutput(true);
> 				connection.setDoInput(false);
> 				save(connection.getOutputStream());
> I could prepare a patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (CONFIGURATION-249) save to URLs with a protocol other than "file:"

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger updated CONFIGURATION-249:
---------------------------------------

    Fix Version/s:     (was: 1.4)
                   1.5

> save to URLs with a protocol other than "file:"
> -----------------------------------------------
>
>                 Key: CONFIGURATION-249
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-249
>             Project: Commons Configuration
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Anselm Kruis
>            Priority: Minor
>             Fix For: 1.5
>
>
> Currently, the save(URL) method from AbstractFileConfiguration only supports "file:" URLs. 
> Why not support  writing to URLs too? It is as simple like this
> 				java.net.URLConnection connection = url.openConnection();
> 				connection.setDoOutput(true);
> 				connection.setDoInput(false);
> 				save(connection.getOutputStream());
> I could prepare a patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (CONFIGURATION-249) save to URLs with a protocol other than "file:"

Posted by "Emmanuel Bourg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489073 ] 

Emmanuel Bourg commented on CONFIGURATION-249:
----------------------------------------------

I changed AbstractFileConfiguration.save(URL) to allow  non file URLs, could you give it a try Anselm ? It worked fine with a FTP server, I have still to build a test case demonstrating this. For HTTP URLs I had to force the PUT method since the POST method is used by default once setDoOutput(true) is called. I haven't tested with a http server allowing PUT requests yet.

> save to URLs with a protocol other than "file:"
> -----------------------------------------------
>
>                 Key: CONFIGURATION-249
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-249
>             Project: Commons Configuration
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Anselm Kruis
>            Priority: Minor
>             Fix For: 1.5
>
>
> Currently, the save(URL) method from AbstractFileConfiguration only supports "file:" URLs. 
> Why not support  writing to URLs too? It is as simple like this
> 				java.net.URLConnection connection = url.openConnection();
> 				connection.setDoOutput(true);
> 				connection.setDoInput(false);
> 				save(connection.getOutputStream());
> I could prepare a patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org