APISonar


org.netbeans.modules.payara.tooling.logging.Logger.log

> org > netbeans > modules > payara > tooling > logging > Logger > log
org APIs netbeans APIs modules APIs payara APIs tooling APIs logging APIs Logger APIs log APIs

Example 1
public static Properties readProperties(String propertiesFile) {
        Properties properties = new Properties();
        try {
            properties.load(new FileInputStream(propertiesFile));
        } catch (IOException ioe) {
            Logger.log(Level.WARNING,
                    "Cannot read " + propertiesFile + " file", ioe);
        }
        return properties;
    }
Example 2
private static String getPayaraProperty(
            Class <? extends CommonTest> pClass, Method pMeth, String key) {
        try {
            return (String)pMeth.invoke(pClass, key);
        } catch (IllegalAccessException | IllegalArgumentException
                | InvocationTargetException iae) {
            Logger.log(Level.WARNING, "Getting Payara property failed: ",
                    iae);
            return null;
        }
    }
Example 3
static URL fileToURL(File file) {
        try {
            return file != null ? file.toURI().normalize().toURL() : null;
        } catch (MalformedURLException ex) {
            Logger.log(Level.WARNING, "Unable to convert file "
                    + file.getAbsolutePath() + " to URL", ex);
            return null;
        }
    }
Example 4
static List<URL> processLinks(FileSet fileset) {
        List<String> links = fileset.getLinks();
        ArrayList<URL> result = new ArrayList<>(links.size());
        for (String urlString : links) {
            try {
                result.add(new URL(urlString));
            } catch (MalformedURLException mue) {
                Logger.log(Level.WARNING, "Cannot process URL: " + urlString
                        + ".", mue);
            }
        }
        return result;
    }
Example 5
private static final Logger LOGGER = new Logger(PasswordFile.class);

    private boolean finishFilePosix() {
        final String METHOD = "finishFilePosix";
        boolean success = false;
        try {
            Files.setPosixFilePermissions(file, FINAL_FILE_PERMISSIONS);
            success = true;
        } catch (UnsupportedOperationException uoe) {
            LOGGER.log(Level.INFO, METHOD, "unsupported", file.toString());
        } catch (IOException ioe) {
            LOGGER.log(Level.INFO, METHOD, "ioException", ioe);
        }
        return success;
    }
Example 6
private static final Logger LOGGER = new Logger(FetchLog.class);

    public void close() {
        final String METHOD = "close";
        if (this.in != null) {
            try {
                this.in.close();
            } catch (IOException ioe) {
                LOGGER.log(Level.INFO, METHOD, "cantClose", ioe);
            }
        } else {
            LOGGER.log(Level.INFO, METHOD, "isNull");
        }
    }
Example 7
void setProcessCurrentDir(ProcessBuilder pb) {
        if (command.domainDir != null && command.domainDir.length() > 0) {
            File currentDir = new File(
                    ServerUtils.getDomainConfigPath(command.domainDir));
            if (currentDir.exists()) {
                Logger.log(Level.FINEST,
                        "Setting {0} process current directory to {1}",
                        new Object[]{server.getName(), command.domainDir});
                pb.directory(currentDir);
            }
        }
    }
Example 8
private static final Logger LOGGER = new Logger(RunnerHttpDeploy.class);

    public InputStream getInputStream() {
        final String METHOD = "getInputStream";
        if (command.dirDeploy) {
            return null;
        } else {
            try {
                return new FileInputStream(command.path);
            } catch (FileNotFoundException fnfe) {
                LOGGER.log(Level.INFO, METHOD, "fileNotFound", fnfe);
                return null;
            }
        }
    }
Example 9
private static final Logger LOGGER = new Logger(RunnerJava.class);

    void setProcessCurrentDir(ProcessBuilder pb) {
        final String METHOD = "setProcessCurrentDir";
        String domainsFolder = server.getDomainsFolder();
        if (domainsFolder != null && domainsFolder.length() > 0) {
            File currentDir = new File(
                    ServerUtils.getDomainConfigPath(domainsFolder));
            if (currentDir.exists()) {
                LOGGER.log(Level.FINEST, METHOD, "dir",
                        new Object[] {server.getName(), currentDir});
                pb.directory(currentDir);
            }
        }
    }
Example 10
private static final Logger LOGGER
            = new Logger(RunnerHttpCreateInstance.class);

    protected boolean processResponse() {
        final String METHOD = "processResponse";
        try {
            result.value = manifest.getMainAttributes().getValue("message");
            result.value = result.value.replace("%%%EOL%%%", "\n");
        } catch (IllegalArgumentException iae) {
            LOGGER.log(Level.WARNING, METHOD, "illegalArgument", iae);
        }
        return result.value != null;
    }
Example 11
private static final Logger LOGGER = new Logger(FetchLogPiped.class);

    public void close() {
        final String METHOD = "close";
        TaskState result = stop();        
        super.close();
        // Clean up internal executor.
        if (internalExecutor) {
            executor.shutdownNow();
        }
        // We may possibly change this to throw an exception when needed.
        // But streams must be cleaned up first.
        if (result != TaskState.COMPLETED) {
            LOGGER.log(Level.INFO, METHOD, "failed");
        }
    }
Example 12
private static final Logger LOGGER = new Logger(RunnerJava.class);

    private static String getJavaVM(final PayaraServer server,
            final CommandJava command) {
        final String METHOD = "getJavaVM";
        String javaVmExe = JavaUtils.javaVmExecutableFullPath(command.javaHome);
        File javaVmFile = new File(javaVmExe);
        // Java VM executable should exist and should be executable.
        if (!javaVmFile.canExecute()) {
            LOGGER.log(Level.INFO, METHOD, "noJavaVMExe", javaVmExe);
            return null;
        }
        return javaVmExe;
    }