Log.logException(Log.ERROR, MODULE, me);
Log.logException(Log.LEVEL_ERROR, MODULE, me);
		boolean uploadPicture(Picture p) {			try	{				URL url = g.getGalleryUrl(SCRIPT_NAME);				String urlPath = url.getFile();				Log.log(Log.TRACE, MODULE, "Url: " + url);							NVPair[] opts = {					new NVPair("set_albumName", p.getAlbum().getName()),					new NVPair("cmd", "add-item"), 					new NVPair("protocal_version", PROTOCAL_VERSION)				};				Log.log(Log.TRACE, MODULE, "add-item parameters: " + Arrays.asList(opts));					NVPair[] afile = { new NVPair("userfile", p.getUploadSource().getAbsolutePath()) };				NVPair[] hdrs = new NVPair[1];				byte[]   data = Codecs.mpFormDataEncode(opts, afile, hdrs);				HTTPConnection mConnection = new HTTPConnection(url);				HTTPResponse rsp = mConnection.Post(urlPath, data, hdrs);								if (rsp.getStatusCode() >= 300 && rsp.getStatusCode() < 400) {					// retry, the library will have fixed the URL					status(StatusUpdate.LEVEL_UPLOAD_ONE, grRes.getString(MODULE, "redirect"));										rsp = mConnection.Post(urlPath, data, hdrs);				}												if (rsp.getStatusCode() >= 300)	{                    Object [] params2 = {new Integer(rsp.getStatusCode()), rsp.getReasonLine()};					error(grRes.getString(MODULE, "httpErr", params2));					return false;				} else {					String response = new String(rsp.getData()).trim();					Log.log(Log.TRACE, MODULE, response);						if (response.indexOf("SUCCESS") >= 0) {						trace(grRes.getString(MODULE, "upldSucc"));						return true;					} else {                        Object [] params = {response };						error(grRes.getString(MODULE, "upldErr", params));						return false;					}				}			} catch (IOException ioe)	{				Log.logException(Log.ERROR, MODULE, ioe);                Object [] params3 = {ioe.toString() };				error(grRes.getString(MODULE, "error", params3));			} catch (ModuleException me) {				Log.logException(Log.ERROR, MODULE, me);                Object [] params3 = {me.getMessage() };				error(grRes.getString(MODULE, "errReq", params3));			}								return false;		}