Code example for MalformedURLException

Methods: getMessage

0
        File file;
        if (path.startsWith("file://")) {
            try { 
                file = FileUtils.toFile(new URL(path));
            } catch (MalformedURLException e) {
                log.error(e.getMessage(), e);
                throw new ScriptException(e);
            } 
        } else { 
            String oldPath = path;
            path = FilenameUtils.normalizeNoEndSeparator(path);
            if (path == null) {
                String msg = "Invalid file path : " + oldPath;
                log.error(msg);
                throw new ScriptException(msg);
            } 
            file = new File(path);
        } 
        if (file.isDirectory()) {
            String msg = "File hostobject doesn't handle directories. Specified path contains a directory : " + path;
            log.error(msg);