this.followRedirects = destInfo.isFollowRedirects();
feedid = destInfo.getLogData();
spool = destInfo.getSpool();
- String dfn = spool + "/" + pubid;
+ String dfn = spool + File.separator + pubid;
String mfn = dfn + ".M";
- datafile = new File(spool + "/" + pubid);
+ datafile = new File(spool + File.separator + pubid);
metafile = new File(mfn);
boolean monly = destInfo.isMetaDataOnly();
date = Long.parseLong(pubid.substring(0, pubid.indexOf('.')));
byte[] buf = new byte[4096];
if (is != null) {
while (is.read(buf) > 0) {
+ //flush the buffer
}
is.close();
}
httpURLConnection.setRequestProperty(DECOMPRESSION_STATUS, "SUCCESS");
OutputStream outputStream = getOutputStream(httpURLConnection);
if (outputStream != null) {
- int bytesRead = 0;
+ int bytesRead;
try (InputStream gzipInputStream = new GZIPInputStream(new FileInputStream(datafile))) {
int bufferLength = buffer.length;
while ((bytesRead = gzipInputStream.read(buffer, 0, bufferLength)) > 0) {
* @param httpURLConnection connection used to make request
* @return AN Outpustream that can be used to send your data.
*/
- private OutputStream getOutputStream(HttpURLConnection httpURLConnection) throws IOException {
+ OutputStream getOutputStream(HttpURLConnection httpURLConnection) throws IOException {
OutputStream outputStream = null;
try {
outputStream = httpURLConnection.getOutputStream();
Files.deleteIfExists(file.toPath());
break;
} catch (IOException e) {
- eelfLogger.error("IOException : Failed to delete file :" + file.getName() + " on attempt " + tryCount, e);
+ eelfLogger.error("IOException : Failed to delete file :"
+ + file.getName() + " on attempt " + tryCount, e);
}
tryCount++;
}
/**
* Get the followRedirects for this delivery task.
*/
- public boolean getFollowRedirects() {
+ boolean getFollowRedirects() {
return (followRedirects);
}
}