本文整理了Java中aQute.bnd.osgi.Builder.appendPath()
方法的一些代码示例,展示了Builder.appendPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Builder.appendPath()
方法的具体详情如下:
包路径:aQute.bnd.osgi.Builder
类名称:Builder
方法名:appendPath
暂无
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
private void resolveFiles(File dir, FileFilter filter, boolean recursive, String path, Map<String, File> files,
boolean flatten) {
if (doNotCopy(dir)) {
return;
}
File[] fs = dir.listFiles(filter);
for (File file : fs) {
if (file.isDirectory()) {
if (recursive) {
String nextPath;
if (flatten)
nextPath = path;
else
nextPath = appendPath(path, file.getName());
resolveFiles(file, filter, recursive, nextPath, files, flatten);
}
// Directories are ignored otherwise
} else {
String p = appendPath(path, file.getName());
if (files.containsKey(p))
warning(Constants.INCLUDE_RESOURCE + " overwrites entry %s from file %s", p, file);
files.put(p, file);
}
}
if (fs.length == 0) {
File empty = new File(dir, Constants.EMPTY_HEADER);
files.put(appendPath(path, empty.getName()), empty);
}
}
代码示例来源:origin: biz.aQute/bndlib
private void resolveFiles(File dir, FileFilter filter, boolean recursive, String path, Map<String,File> files,
boolean flatten) {
if (doNotCopy(dir.getName())) {
return;
}
File[] fs = dir.listFiles(filter);
for (File file : fs) {
if (file.isDirectory()) {
if (recursive) {
String nextPath;
if (flatten)
nextPath = path;
else
nextPath = appendPath(path, file.getName());
resolveFiles(file, filter, recursive, nextPath, files, flatten);
}
// Directories are ignored otherwise
} else {
String p = appendPath(path, file.getName());
if (files.containsKey(p))
warning("Include-Resource overwrites entry %s from file %s", p, file);
files.put(p, file);
}
}
if (fs.length == 0) {
File empty = new File(dir, Constants.EMPTY_HEADER);
files.put(appendPath(path, empty.getName()), empty);
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
private void resolveFiles(File dir, FileFilter filter, boolean recursive, String path, Map<String,File> files,
boolean flatten) {
if (doNotCopy(dir.getName())) {
return;
}
File[] fs = dir.listFiles(filter);
for (File file : fs) {
if (file.isDirectory()) {
if (recursive) {
String nextPath;
if (flatten)
nextPath = path;
else
nextPath = appendPath(path, file.getName());
resolveFiles(file, filter, recursive, nextPath, files, flatten);
}
// Directories are ignored otherwise
} else {
String p = appendPath(path, file.getName());
if (files.containsKey(p))
warning(Constants.INCLUDE_RESOURCE + " overwrites entry %s from file %s", p, file);
files.put(p, file);
}
}
if (fs.length == 0) {
File empty = new File(dir, Constants.EMPTY_HEADER);
files.put(appendPath(path, empty.getName()), empty);
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
private void resolveFiles(File dir, FileFilter filter, boolean recursive, String path, Map<String, File> files,
boolean flatten) {
if (doNotCopy(dir)) {
return;
}
File[] fs = dir.listFiles(filter);
for (File file : fs) {
if (file.isDirectory()) {
if (recursive) {
String nextPath;
if (flatten)
nextPath = path;
else
nextPath = appendPath(path, file.getName());
resolveFiles(file, filter, recursive, nextPath, files, flatten);
}
// Directories are ignored otherwise
} else {
String p = appendPath(path, file.getName());
if (files.containsKey(p))
warning(Constants.INCLUDE_RESOURCE + " overwrites entry %s from file %s", p, file);
files.put(p, file);
}
}
if (fs.length == 0) {
File empty = new File(dir, Constants.EMPTY_HEADER);
files.put(appendPath(path, empty.getName()), empty);
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
private void resolveFiles(File dir, FileFilter filter, boolean recursive, String path, Map<String,File> files,
boolean flatten) {
if (doNotCopy(dir.getName())) {
return;
}
File[] fs = dir.listFiles(filter);
for (File file : fs) {
if (file.isDirectory()) {
if (recursive) {
String nextPath;
if (flatten)
nextPath = path;
else
nextPath = appendPath(path, file.getName());
resolveFiles(file, filter, recursive, nextPath, files, flatten);
}
// Directories are ignored otherwise
} else {
String p = appendPath(path, file.getName());
if (files.containsKey(p))
warning(Constants.INCLUDE_RESOURCE + " overwrites entry %s from file %s", p, file);
files.put(p, file);
}
}
if (fs.length == 0) {
File empty = new File(dir, Constants.EMPTY_HEADER);
files.put(appendPath(path, empty.getName()), empty);
}
}
代码示例来源:origin: biz.aQute/bndlib
private void copy(Jar jar, String path, File from, boolean preprocess, Map<String,String> extra) throws Exception {
if (doNotCopy(from.getName()))
return;
if (from.isDirectory()) {
File files[] = from.listFiles();
for (int i = 0; i < files.length; i++) {
copy(jar, appendPath(path, files[i].getName()), files[i], preprocess, extra);
}
} else {
if (from.exists()) {
Resource resource = new FileResource(from);
if (preprocess) {
resource = new PreprocessResource(this, resource);
}
String x = extra.get("extra");
if (x != null)
resource.setExtra(x);
if (path.endsWith("/"))
path = path + from.getName();
jar.putResource(path, resource);
if (isTrue(extra.get(LIB_DIRECTIVE))) {
setProperty(BUNDLE_CLASSPATH, append(getProperty(BUNDLE_CLASSPATH), path));
}
} else if (from.getName().equals(Constants.EMPTY_HEADER)) {
jar.putResource(path, new EmbeddedResource(new byte[0], 0));
} else {
error("Input file does not exist: " + from);
}
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
private void copy(Jar jar, String path, File from, Instructions preprocess, Map<String, String> extra)
throws Exception {
if (doNotCopy(from))
return;
logger.debug("copy d={} s={} path={}", jar, from, path);
if (from.isDirectory()) {
File files[] = from.listFiles();
for (int i = 0; i < files.length; i++) {
copy(jar, appendPath(path, files[i].getName()), files[i], preprocess, extra);
}
} else {
if (from.exists()) {
Resource resource = new FileResource(from);
if (preprocess != null && preprocess.matches(path)) {
resource = new PreprocessResource(this, resource);
}
String x = extra.get("extra");
if (x != null)
resource.setExtra(x);
if (path.endsWith("/"))
path = path + from.getName();
copy(jar, path, resource, extra);
} else if (from.getName()
.equals(Constants.EMPTY_HEADER)) {
jar.putResource(path, new EmbeddedResource(new byte[0], 0L));
} else {
error("Input file does not exist: %s", from).header(INCLUDERESOURCE + "|" + INCLUDE_RESOURCE);
}
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
private void copy(Jar jar, String path, File from, Instructions preprocess, Map<String, String> extra)
throws Exception {
if (doNotCopy(from))
return;
logger.debug("copy d={} s={} path={}", jar, from, path);
if (from.isDirectory()) {
File files[] = from.listFiles();
for (int i = 0; i < files.length; i++) {
copy(jar, appendPath(path, files[i].getName()), files[i], preprocess, extra);
}
} else {
if (from.exists()) {
Resource resource = new FileResource(from);
if (preprocess != null && preprocess.matches(path)) {
resource = new PreprocessResource(this, resource);
}
String x = extra.get("extra");
if (x != null)
resource.setExtra(x);
if (path.endsWith("/"))
path = path + from.getName();
copy(jar, path, resource, extra);
} else if (from.getName()
.equals(Constants.EMPTY_HEADER)) {
jar.putResource(path, new EmbeddedResource(new byte[0], 0L));
} else {
error("Input file does not exist: %s", from).header(INCLUDERESOURCE + "|" + INCLUDE_RESOURCE);
}
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
copy(jar, appendPath(path, files[i].getName()), files[i], preprocess, extra);
代码示例来源:origin: biz.aQute.bnd/bnd
copy(jar, appendPath(path, files[i].getName()), files[i], preprocess, extra);
内容来源于网络,如有侵权,请联系作者删除!