net.sf.bt747.j2se.app.osm
Class OsmGpxUpload
java.lang.Object
net.sf.bt747.j2se.app.osm.OsmGpxUpload
public class OsmGpxUpload
- extends java.lang.Object
Small java class that allows to upload gpx files to www.openstreetmap.org
via its api call.
- Author:
- Christof Dallermassl, Mario De Weerd
Field Summary |
static java.lang.String |
API_VERSION
The API version of the OSM interface to use. |
Method Summary |
static java.lang.String |
encodeBase64(java.lang.String s)
Encode a string to base64. |
static void |
upload(java.lang.String username,
java.lang.String password,
java.lang.String description,
java.lang.String tags,
java.io.File gpxFile,
java.lang.String visibility)
|
static void |
writeContentDisposition(java.io.DataOutputStream out,
java.lang.String name,
java.lang.String value)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
API_VERSION
public static final java.lang.String API_VERSION
- The API version of the OSM interface to use.
- See Also:
- Constant Field Values
OsmGpxUpload
public OsmGpxUpload()
upload
public static final void upload(java.lang.String username,
java.lang.String password,
java.lang.String description,
java.lang.String tags,
java.io.File gpxFile,
java.lang.String visibility)
throws java.io.IOException
- Parameters:
username
- password
- description
- tags
- gpxFile
-
- Throws:
java.io.IOException
writeContentDisposition
public static final void writeContentDisposition(java.io.DataOutputStream out,
java.lang.String name,
java.lang.String value)
throws java.io.IOException
- Parameters:
out
- Where to write the content disposition.name
- The name for the content.value
- The value to write.
- Throws:
java.io.IOException
- Exceptions related to output stream.
encodeBase64
public static final java.lang.String encodeBase64(java.lang.String s)
- Encode a string to base64.
- Parameters:
s
- The string to encode.
- Returns:
- The encoded string.