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

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


                }
            }
        } catch (Exception exc) {
            log("Exception -decodeEncFileMap- exc:" + exc);
            exc(exc);
            throw new BaseApplicationException("Can't login. Please check your username and password.")
                    .setErrorType(BaseApplicationException.ErrorType.ERROR);
        }

        if (!maki_file_map.exists()) {
View Full Code Here


        try {
            ris = AES2Manager.<EncryptedMap>decryptFileJAXBCheck(master_password, maki_file_map, EncryptedMap.class);
            em = ris.getObject();
        } catch (Exception exc) {
            throw new BaseApplicationException("Can't login. Please check your username and password.")
                    .setErrorType(BaseApplicationException.ErrorType.WARNING);
        }

        return em;
    }
View Full Code Here

            if (em == null) {

                master_password = previous_master_password;

                log("SAVE - ecryptToFileFinally - ERROR EncryptedMap is NULL!");
                throw new BaseApplicationException(__ERROR_TEXT_UNMAR)
                        .setErrorType(BaseApplicationException.ErrorType.ERROR);
            }

            log("SAVE - ecryptToFileFinally DONE!");

            temp_master_password = null;

        } catch (Exception exc) {

            master_password = previous_master_password;

            UtilityFX.warning("### ERROR ### - error while saving user data. - ecryptToFileFinally - EXC: " + exc);
            UtilityFX.exc(exc);
            exc.printStackTrace();

            throw new BaseApplicationException(__ERROR_TEXT_UNMAR)
                    .setErrorType(BaseApplicationException.ErrorType.ERROR);
        }
    }
View Full Code Here

            String text_reloaded = AES.decryptFile(master_password, maki_file_map);
            EncryptedMap em = reloadEncryptedSavedData(text_reloaded);

            if (em == null) {
                log("SAVE - ecryptToFileFinally - ERROR EncryptedMap is NULL!");
                throw new BaseApplicationException(__ERROR_TEXT_UNMAR)
                        .setErrorType(BaseApplicationException.ErrorType.ERROR);
            }

            log("SAVE - ecryptToFileFinally DONE!");

        } catch (Exception exc) {
            UtilityFX.warning("### ERROR ### - error while saving user data. - ecryptToFileFinally - EXC: " + exc);
            UtilityFX.exc(exc);
            exc.printStackTrace();
            throw new BaseApplicationException(__ERROR_TEXT_UNMAR)
                    .setErrorType(BaseApplicationException.ErrorType.ERROR);
        }
    }
View Full Code Here

        }

        log("FINE READ DATA SIZE:" + RIS.size());

        if (RIS.isEmpty()) {
            throw new BaseApplicationException("Can't login. Please check your username and password.")
                    .setErrorType(BaseApplicationException.ErrorType.WARNING);
        }
        return RIS.get(0);
    }
View Full Code Here

                }
            }
        } catch (Exception exc) {
            log("Exception -decodeEncFileMap- exc:" + exc);
            exc(exc);
            throw new BaseApplicationException("Can't login. Please check your username and password.")
                    .setErrorType(BaseApplicationException.ErrorType.ERROR);
        }

        if (!maki_file_map.exists()) {
            return firstEncyptedMap();
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

TOP

Related Classes of org.rat.free.security.makifx.common.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.