Package org.rat.free.security.makifx.exception

Examples of org.rat.free.security.makifx.exception.BaseApplicationException


            enc = __result;

            return enc;

        } catch (Exception exc) {
            throw new BaseApplicationException(
                    "Warning, can't encrypt data ")
                    .setErrorType(BaseApplicationException.ErrorType.WARNING)
                    .setException(exc);
        } finally {
            key = null;
View Full Code Here


            decvalue = c.doFinal(__enc_value);

            return decvalue;

        } catch (Exception exc) {
            throw new BaseApplicationException(
                    "Warning, can't decrypt data ")
                    .setErrorType(BaseApplicationException.ErrorType.WARNING)
                    .setException(exc);
        }
    }
View Full Code Here

            log("{INFO ZIP} " + Thread.currentThread() + " --> =================================================");

        } catch (Exception e) {
            exc(e);
            throw new BaseApplicationException("Zip Error! ERR: " + e.toString())
                    .setException(e)
                    .setErrorType(BaseApplicationException.ErrorType.ERROR);
        }
    }
View Full Code Here

            /*if (!del && isOsLinux()) {
             executeCommand("chmod 777 " + todelete.toString());
             todelete.delete();
             }*/
            if (todelete.exists()) {
                throw new BaseApplicationException("Can't delete file " + todelete)
                        .setErrorType(BaseApplicationException.ErrorType.ERROR);
            }
        }
    }
View Full Code Here

            } 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);
        }
        //--------------------------------------------------------------------//
        //--------------------------------------------------------------------//
View Full Code Here

            EnumSet<FileVisitOption> opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS);

            tc = new AnalizerTreeStructure(Paths.get(s.toString()), Paths.get(d.toString()), visitor);

            Files.walkFileTree(Paths.get(s.toString()), opts, Integer.MAX_VALUE, tc);
            BaseApplicationException base_exc = tc.getException();

            if (base_exc != null) {
                throw base_exc;
            }

        } catch (Exception exc) {

            if (tc != null && tc.getException() != null) {
                throw tc.getException();
            }

            throw new BaseApplicationException("Error while copy file from: " + s + ", to: " + d)
                    .setErrorType(BaseApplicationException.ErrorType.ERROR)
                    .setException(exc);
        }
    }
View Full Code Here

                dir_created.toFile().mkdirs();
                return FileVisitResult.CONTINUE;
            } catch (Exception exc) {
                Utility.warning("Exception EXC:" + exc.toString());
                exc.printStackTrace();
                exception = new BaseApplicationException(exc.toString()).setException(exc);
                return FileVisitResult.TERMINATE;
            }
        }
View Full Code Here

TOP

Related Classes of org.rat.free.security.makifx.exception.BaseApplicationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.