public static File convertUrlToFile(URL url) { return new File(convertUrlToFilePath(url)); }
public FileMerge(URL url, String destination, Map<OutputStream, List<String>> mergeContent) { this.mergeContent = mergeContent; this.sourceToCopy = FileUtil.convertUrlToFile(url); this.destination = destination; }
/** * Returns the text from the specified file. * * @param path the file path * @return the corresponding text, or {@code null} if the file could not be read */ protected List<String> getText(String path) { List<String> text = null; try { text = FileUtil.getFileContent(path); } catch (IOException ignore) { if (log.isLoggable(Level.FINE)) { log.log(Level.FINE, "Failed to read " + path, ignore); } } return text; }
private TargetFileSet readFileSet(IXMLElement fileSetNode, File baseDir) throws CompilerException { String dir_attr = getDirSubstitutedAttributeValue(fileSetNode); File extractedBaseDir = baseDir; if (dir_attr != null) { extractedBaseDir = FileUtil.getAbsoluteFile(dir_attr, baseDir.getAbsolutePath()); } String targetDir = fileSetNode.getAttribute("targetdir", "${INSTALL_PATH}"); return readFileSet(fileSetNode, extractedBaseDir, targetDir); }
/** * Constructs and initializes from a source file. * * @param baseDir the baseDirectory of the Fileselection/compilation or null * @param src file which this PackFile describes * @param target the path to install the file to * @param osList OS constraints * @param override what to do when the file already exists * @throws FileNotFoundException if the specified file does not exist. */ public PackFile(File baseDir, File src, String target, List<OsModel> osList, OverrideType override, String overrideRenameTo, Blockable blockable, Map<String, String> pack200Properties) throws IOException { this(src, FileUtil.getRelativeFileName(src, baseDir), target, osList, override, overrideRenameTo, blockable, null, pack200Properties); }
File file = FileUtil.getLockFile(appName); if (file.exists())
String[] subDirJars = FileUtil.getFileNames(rawJar, new FilenameFilter()
long dateTime = FileUtil.getFileDateTime(url); if (dateTime != -1)
private void readConfigFileTaskCommonAttributes(InstallData idata, IXMLElement el, ConfigFileTask task) throws InstallerException { File tofile = FileUtil.getAbsoluteFile(replacer.substitute(requireAttribute(el, "tofile")), idata.getInstallPath()); task.setToFile(tofile); task.setOldFile(FileUtil.getAbsoluteFile(getAttribute(el, "patchfile"), idata.getInstallPath())); File newfile = FileUtil.getAbsoluteFile(getAttribute(el, "originalfile"), idata.getInstallPath()); task.setNewFile(newfile); String boolattr = getAttribute(el, "cleanup"); if (boolattr != null) { task.setCleanup(Boolean.parseBoolean(boolattr)); } }
/** * Constructs and initializes from a source file. * * @param baseDir The Base directory that is used to search for the files. This is used to build the relative path's * @param src file which this PackFile describes * @param target the path to install the file to * @param osList OS constraints * @param override what to do when the file already exists * @param additionals additional attributes * @throws FileNotFoundException if the specified file does not exist. */ public PackFile(File baseDir, File src, String target, List<OsModel> osList, OverrideType override, String overrideRenameTo, Blockable blockable, Map additionals, Map<String, String> pack200Properties) throws IOException { this(src, FileUtil.getRelativeFileName(src, baseDir), target, osList, override, overrideRenameTo, blockable, additionals, pack200Properties); }
FileUtil.getLockFile(installData.getInfo().getAppName()).delete(); if (runner.relaunchWithElevatedRights() == 0)
if (strattr != null) fs.setDir(FileUtil.getAbsoluteFile(strattr, installPath)); if (strattr != null) fs.setFile(FileUtil.getAbsoluteFile(strattr, installPath));
public static boolean isUrlContainingPackage(URL url, String aPackage) { return FileUtil.convertUrlToFilePath(url).contains(aPackage.replaceAll("\\.", "/")); } }
public static boolean isFile(URL url) { return !FileUtil.convertUrlToFile(url).isDirectory(); }
result.append(FileUtil.getFileContent(getReleaseFileName())).append(NL);
task.setToDir(FileUtil.getAbsoluteFile(getAttribute(el, "todir"), idata.getInstallPath())); task.setToFile(FileUtil.getAbsoluteFile(getAttribute(el, "tofile"), idata.getInstallPath())); task.setFile(FileUtil.getAbsoluteFile(getAttribute(el, "fromfile"), idata.getInstallPath())); String boolattr = getAttribute(el, "keepOldKeys"); if (boolattr != null)
public static String processUrlToJarPath(URL resource) { String res = FileUtil.convertUrlToFilePath(resource); res = res.replaceAll("file:", ""); if (res.contains("!")) { return res.substring(0, res.lastIndexOf("!")); } return res; }
public static String processURLToClassName(URL url) { return processFileToClassName(FileUtil.convertUrlToFile(url)); }
result = SUSE + SP + LINUX + NL + StringTool.listToString(FileUtil.getFileContent(getReleaseFileName())); result = REDHAT + SP + LINUX + NL + StringTool.listToString(FileUtil.getFileContent(getReleaseFileName())); + StringTool.listToString(FileUtil.getFileContent(getReleaseFileName())); + StringTool.listToString(FileUtil.getFileContent(getReleaseFileName())); + StringTool.listToString(FileUtil.getFileContent(getReleaseFileName())); + StringTool.listToString(FileUtil.getFileContent("/etc/debian_version")); + StringTool.listToString(FileUtil.getFileContent(getReleaseFileName()));
File abssrcfile = FileUtil.getAbsoluteFile(src, baseDir.getAbsolutePath()); if (!abssrcfile.exists())