} catch (Exception exc) {
log("EXCEPTION IN TEST2 COPY exc:" + exc.toString());
String texc = exc.getLocalizedMessage() != null ? exc.getLocalizedMessage() : exc.toString();
exc(exc);
exc.printStackTrace();
throw new BaseApplicationException(
"Error while copying file!\nFILE: " + sname + "\nTO: " + dname + "\n" + texc)
.setErrorType(BaseApplicationException.ErrorType.ERROR)
.setException(exc);
} finally {
try {
if (in != null) {
in.close();
}
if (out != null) {
out.flush();
out.close();
}
} catch (Exception exc) {
}
}
}
//--------------------------------------------------------------------//
//--------------------------------------------------------------------//
//--------------------------------------------------------------------//
// CONTROLLO SE LA COPIA E' STATA CORRETTA ANALIZZO IL CKSUM //
//--------------------------------------------------------------------//
//--------------------------------------------------------------------//
//--------------------------------------------------------------------//
String sname = null;
String dname = null;
File f1 = new File(s);
File f2 = new File(d);
sname = f1.getName();
dname = f2.getParentFile().toString();
boolean isEquals = isSameFile(f1, f2);
log("CKSUM TEST: " + f2 + " RESULT: " + isEquals);
log("------------------------------------------");
if (!isEquals) {
throw new BaseApplicationException(
"Check same File error while copying data!\nFILE: " + sname + "\nTO: " + dname)
.setErrorType(BaseApplicationException.ErrorType.ERROR);
}
//--------------------------------------------------------------------//
//--------------------------------------------------------------------//