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

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


    }

    public <T> T loadJFXUI(@Nonnull final String resource) throws IOException, BaseApplicationException {
        URL url = singleton.getClass().getResource(_BASE_ + resource);
        if (url == null) {
            throw new BaseApplicationException(
                    "URL not found, resource = " + _BASE_ + resource
                    + " please, don't use base resource path only like \'"
                    + "gui/foo.fxml\'")
                    .setErrorType(BaseApplicationException.ErrorType.ERROR);
        }
View Full Code Here


         * Cerca nel jar le classi che estendono AbstractPlugin e crea nuovi oggetti
         * iniettando istanze di manager (this) oppure del root_node, cioe' il nodo
         * radice salvato nella mappa cifrata.
         */
        if (manager == null) {
            throw new BaseApplicationException("Null manager interface.")
                    .setErrorType(BaseApplicationException.ErrorType.FATAL);
        }

        /**
         * Creo una lista di classi dei vari plugin.
         */
        @SuppressWarnings("UnusedAssignment")
        List<PluginProvider> plugins = null;
        List<Class> list = null;
        try {
            list = listDataClasses(_PLUGIN_RESOURCE_PATH_);
            if (list == null || list.isEmpty()) {
                throw new BaseApplicationException("No plugin found.")
                        .setErrorType(BaseApplicationException.ErrorType.FATAL);
            }
        } catch (Exception exc) {
            throw new BaseApplicationException("Error during load plugin.")
                    .setErrorType(BaseApplicationException.ErrorType.FATAL);
        }

        /**
         * Istanzio i vari plugin, ed li inserisco in una lista che andro' ad
View Full Code Here

         * Cerca nel jar le classi che estendono AbstractPlugin e crea nuovi oggetti
         * iniettando istanze di manager (this) oppure del root_node, cioe' il nodo
         * radice salvato nella mappa cifrata.
         */
        if (manager == null) {
            throw new BaseApplicationException("Null manager interface.")
                    .setErrorType(BaseApplicationException.ErrorType.FATAL);
        }

        List<PluginProvider> plugins = null;

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

            System.gc();

            boolean del = 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) {
                UtilityFX.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.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.