本文整理了Java中info.magnolia.cms.core.Path.getAbsoluteFileSystemPath()
方法的一些代码示例,展示了Path.getAbsoluteFileSystemPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.getAbsoluteFileSystemPath()
方法的具体详情如下:
包路径:info.magnolia.cms.core.Path
类名称:Path
方法名:getAbsoluteFileSystemPath
暂无
代码示例来源:origin: info.magnolia/magnolia-module-data
public void setZipFileURL(String url) {
if (!StringUtils.contains(url, "://")) {
this.zipFileURL = "file://" + Path.getAbsoluteFileSystemPath(url);
}
else {
this.zipFileURL = url;
}
}
代码示例来源:origin: info.magnolia/magnolia-module-data
public void setFileURL(String url) {
if (!StringUtils.contains(url, "://")) {
this.fileURL = "file://" + Path.getAbsoluteFileSystemPath(url);
}
else {
this.fileURL = url;
}
}
代码示例来源:origin: net.sourceforge.openutils/openutils-mgnltests
private void extractConfigFile(String propertyName, InputStream configFileStream, String extractToPath)
throws Exception
{
String targetFilename = Path.getAbsoluteFileSystemPath(extractToPath);
File targetFile = new File(targetFilename);
// extract resource to the filesystem (jackrabbit can't use a stream)
new File(targetFile.getParent()).mkdirs();
IOUtils.copy(configFileStream, new FileOutputStream(targetFile));
SystemProperty.setProperty(propertyName, extractToPath);
}
代码示例来源:origin: net.sourceforge.openutils/openutils-mgnlutils
private void exportNode(String repository, Session session, Node exported, boolean dev) throws IOException,
RepositoryException
{
String handle = exported.getPath();
String xmlName = repository + StringUtils.replace(handle, "/", ".") + ".xml";
xmlName = DataTransporter.encodePath(xmlName, ".", "UTF-8");
// create necessary parent directories
File folder = new File(Path.getAbsoluteFileSystemPath(dev && !StringUtils.contains(rootdir, "-dev") ? rootdir
+ "-dev" : rootdir));
folder.mkdirs();
File xmlFile = new File(folder.getAbsoluteFile(), xmlName);
FileOutputStream fos = new FileOutputStream(xmlFile);
try
{
DataTransporter.executeExport(fos, false, true, session, handle, repository, DataTransporter.XML);
}
finally
{
IOUtils.closeQuietly(fos);
}
}
代码示例来源:origin: net.sourceforge.openutils/openutils-mgnlutils
public String accept(String resourcePath)
{
if (!FilesExtractionTask.this.accept(resourcePath))
{
return null;
}
final String relTargetPath = StringUtils.removeStart(resourcePath, "/mgnl-files/");
return Path.getAbsoluteFileSystemPath(relTargetPath);
}
代码示例来源:origin: net.sourceforge.openutils/openutils-mgnlutils
public String accept(String resourcePath)
{
final boolean thisIsAFileWeWant = resourcePath.startsWith("/mgnl-files/")
&& StringUtils.contains(resourcePath, "/samples-"
+ ctx.getCurrentModuleDefinition().getName()
+ "/");
if (!thisIsAFileWeWant)
{
return null;
}
final String relTargetPath = StringUtils.removeStart(resourcePath, "/mgnl-files/");
return Path.getAbsoluteFileSystemPath(relTargetPath);
}
代码示例来源:origin: info.magnolia/magnolia-core
@Test
public void getAbsoluteFileSystemPathReturnsArgumentIfPathIsAbsolute() throws Exception {
String absPath = "/foo/bar";
String returnedPath = Path.getAbsoluteFileSystemPath(absPath);
assertEquals(absPath, returnedPath);
}
代码示例来源:origin: info.magnolia/magnolia-module-forum
public boolean check(InstallContext installContext) {
String home = SystemProperty.getProperty("magnolia.repositories.home");
File repoHome = new File(Path.getAbsoluteFileSystemPath(home));
代码示例来源:origin: info.magnolia/magnolia-core
@Test
public void getAbsoluteFileSystemPathPrependsApplicationRootDirIfPathIsRelative() throws Exception {
String relPath = "WEB-INF/config";
String returnedPath = Path.getAbsoluteFileSystemPath(relPath);
assertEquals(Path.getAppRootDir().getCanonicalPath() + "/" + relPath, returnedPath);
}
代码示例来源:origin: net.sourceforge.openutils/openutils-mgnlutils
+ new File(Path.getAbsoluteFileSystemPath(rootdir)).getCanonicalPath());
内容来源于网络,如有侵权,请联系作者删除!