fix IOUtils import and usage
This commit is contained in:
parent
c321bf2084
commit
3b9bf6c688
2 changed files with 6 additions and 2 deletions
|
@ -11,6 +11,8 @@ import java.io.InputStream;
|
|||
import java.io.OutputStream;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
import de.unibremen.informatik.hets.common.io.IOUtils;
|
||||
|
||||
public class HttpPostMultipart {
|
||||
URLConnection connection;
|
||||
OutputStream os = null;
|
||||
|
@ -51,7 +53,7 @@ public class HttpPostMultipart {
|
|||
type = "application/octet-stream";
|
||||
write("Content-Type: " + type + "\r\n");
|
||||
write("\r\n");
|
||||
pipe(new FileInputStream((File)object), os);
|
||||
IOUtils.copy(new FileInputStream((File)object), os);
|
||||
} else {
|
||||
write("\r\n");
|
||||
write("\r\n");
|
||||
|
|
|
@ -11,6 +11,8 @@ import java.io.InputStream;
|
|||
import java.io.OutputStream;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
import de.unibremen.informatik.hets.common.io.IOUtils;
|
||||
|
||||
public class HttpPostUrlencoded {
|
||||
URLConnection connection;
|
||||
OutputStream os = null;
|
||||
|
@ -38,7 +40,7 @@ public class HttpPostUrlencoded {
|
|||
|
||||
write(name + "=");
|
||||
if (object instanceof File) {
|
||||
write(URLEncoder.encode(InputStreamToString(new FileInputStream((File)object)), "UTF-8"));
|
||||
write(URLEncoder.encode(IOUtils.getString(new FileInputStream((File)object)), "UTF-8"));
|
||||
} else {
|
||||
write(object.toString());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue