本文整理了Java中aQute.bnd.osgi.Builder.copy()
方法的一些代码示例,展示了Builder.copy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Builder.copy()
方法的具体详情如下:
包路径:aQute.bnd.osgi.Builder
类名称:Builder
方法名:copy
[英]Cop
[中]警察
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
case SPLIT_MERGE_LAST :
for (Jar srce : providers) {
copy(dest, srce, path, true);
copy(dest, srce, path, false);
copy(dest, providers.get(0), path, false);
break;
warning("%s", diagnostic(path, providers));
for (Jar srce : providers) {
copy(dest, srce, path, false);
代码示例来源:origin: biz.aQute/bndlib
case SPLIT_MERGE_LAST :
for (Jar srce : providers) {
copy(dest, srce, path, true);
copy(dest, srce, path, false);
copy(dest, providers.get(0), path, false);
break;
warning("%s", diagnostic(path, providers));
for (Jar srce : providers) {
copy(dest, srce, path, false);
代码示例来源:origin: biz.aQute.bnd/bndlib
case SPLIT_MERGE_LAST :
for (Jar srce : providers) {
copy(dest, srce, path, true);
copy(dest, srce, path, false);
copy(dest, providers.get(0), path, false);
break;
warning("%s", diagnostic(path, providers));
for (Jar srce : providers) {
copy(dest, srce, path, false);
代码示例来源: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/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.bndlib
private void noSuchFile(Jar jar, String clause, Map<String, String> extra, String source, String destinationPath)
throws Exception {
List<Jar> src = getJarsFromName(source, Constants.INCLUDE_RESOURCE + " " + source);
if (!src.isEmpty()) {
for (Jar j : src) {
String quoted = j.getSource() != null ? j.getSource()
.getName() : j.getName();
// Do not touch the manifest so this also
// works for signed files.
j.setDoNotTouchManifest();
JarResource jarResource = new JarResource(j);
String path = destinationPath.replace(source, quoted);
logger.debug("copy d={} s={} path={}", jar, j, path);
copy(jar, path, jarResource, extra);
}
} else {
Resource lastChance = make.process(source);
if (lastChance != null) {
String x = extra.get("extra");
if (x != null)
lastChance.setExtra(x);
copy(jar, destinationPath, lastChance, extra);
} else
error("Input file does not exist: %s", source).header(source)
.context(clause);
}
}
代码示例来源:origin: biz.aQute/bndlib
private String doResourceDirectory(Jar jar, Map<String,String> extra, boolean preprocess, File sourceFile,
String destinationPath) throws Exception {
String filter = extra.get("filter:");
boolean flatten = isTrue(extra.get("flatten:"));
boolean recursive = true;
String directive = extra.get("recursive:");
if (directive != null) {
recursive = isTrue(directive);
}
Instruction.Filter iFilter = null;
if (filter != null) {
iFilter = new Instruction.Filter(new Instruction(filter), recursive, getDoNotCopy());
} else {
iFilter = new Instruction.Filter(null, recursive, getDoNotCopy());
}
Map<String,File> files = newMap();
resolveFiles(sourceFile, iFilter, recursive, destinationPath, files, flatten);
for (Map.Entry<String,File> entry : files.entrySet()) {
copy(jar, entry.getKey(), entry.getValue(), preprocess, extra);
}
return destinationPath;
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
private String doResourceDirectory(Jar jar, Map<String, String> extra, Instructions preprocess, File sourceFile,
String destinationPath) throws Exception {
String filter = extra.get("filter:");
boolean flatten = isTrue(extra.get("flatten:"));
boolean recursive = true;
String directive = extra.get("recursive:");
if (directive != null) {
recursive = isTrue(directive);
}
Instruction.Filter iFilter = null;
if (filter != null) {
iFilter = new Instruction.Filter(new Instruction(filter), recursive, getDoNotCopy());
} else {
iFilter = new Instruction.Filter(null, recursive, getDoNotCopy());
}
Map<String, File> files = newMap();
resolveFiles(sourceFile, iFilter, recursive, destinationPath, files, flatten);
for (Map.Entry<String, File> entry : files.entrySet()) {
copy(jar, entry.getKey(), entry.getValue(), preprocess, extra);
}
return destinationPath;
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
private void noSuchFile(Jar jar, String clause, Map<String, String> extra, String source, String destinationPath)
throws Exception {
List<Jar> src = getJarsFromName(source, Constants.INCLUDE_RESOURCE + " " + source);
if (!src.isEmpty()) {
for (Jar j : src) {
String quoted = j.getSource() != null ? j.getSource()
.getName() : j.getName();
// Do not touch the manifest so this also
// works for signed files.
j.setDoNotTouchManifest();
JarResource jarResource = new JarResource(j);
String path = destinationPath.replace(source, quoted);
logger.debug("copy d={} s={} path={}", jar, j, path);
copy(jar, path, jarResource, extra);
}
} else {
Resource lastChance = make.process(source);
if (lastChance != null) {
String x = extra.get("extra");
if (x != null)
lastChance.setExtra(x);
copy(jar, destinationPath, lastChance, extra);
} else
error("Input file does not exist: %s", source).header(source)
.context(clause);
}
}
代码示例来源: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.bnd
private String doResourceDirectory(Jar jar, Map<String, String> extra, Instructions preprocess, File sourceFile,
String destinationPath) throws Exception {
String filter = extra.get("filter:");
boolean flatten = isTrue(extra.get("flatten:"));
boolean recursive = true;
String directive = extra.get("recursive:");
if (directive != null) {
recursive = isTrue(directive);
}
Instruction.Filter iFilter = null;
if (filter != null) {
iFilter = new Instruction.Filter(new Instruction(filter), recursive, getDoNotCopy());
} else {
iFilter = new Instruction.Filter(null, recursive, getDoNotCopy());
}
Map<String, File> files = newMap();
resolveFiles(sourceFile, iFilter, recursive, destinationPath, files, flatten);
for (Map.Entry<String, File> entry : files.entrySet()) {
copy(jar, entry.getKey(), entry.getValue(), preprocess, extra);
}
return destinationPath;
}
代码示例来源:origin: biz.aQute.bnd/bnd
private String doResourceDirectory(Jar jar, Map<String,String> extra, Instructions preprocess, File sourceFile,
String destinationPath) throws Exception {
String filter = extra.get("filter:");
boolean flatten = isTrue(extra.get("flatten:"));
boolean recursive = true;
String directive = extra.get("recursive:");
if (directive != null) {
recursive = isTrue(directive);
}
Instruction.Filter iFilter = null;
if (filter != null) {
iFilter = new Instruction.Filter(new Instruction(filter), recursive, getDoNotCopy());
} else {
iFilter = new Instruction.Filter(null, recursive, getDoNotCopy());
}
Map<String,File> files = newMap();
resolveFiles(sourceFile, iFilter, recursive, destinationPath, files, flatten);
for (Map.Entry<String,File> entry : files.entrySet()) {
copy(jar, entry.getKey(), entry.getValue(), preprocess, extra);
}
return destinationPath;
}
代码示例来源:origin: biz.aQute.bnd/bndlib
private String doResourceDirectory(Jar jar, Map<String,String> extra, Instructions preprocess, File sourceFile,
String destinationPath) throws Exception {
String filter = extra.get("filter:");
boolean flatten = isTrue(extra.get("flatten:"));
boolean recursive = true;
String directive = extra.get("recursive:");
if (directive != null) {
recursive = isTrue(directive);
}
Instruction.Filter iFilter = null;
if (filter != null) {
iFilter = new Instruction.Filter(new Instruction(filter), recursive, getDoNotCopy());
} else {
iFilter = new Instruction.Filter(null, recursive, getDoNotCopy());
}
Map<String,File> files = newMap();
resolveFiles(sourceFile, iFilter, recursive, destinationPath, files, flatten);
for (Map.Entry<String,File> entry : files.entrySet()) {
copy(jar, entry.getKey(), entry.getValue(), preprocess, extra);
}
return destinationPath;
}
代码示例来源:origin: biz.aQute.bnd/bnd
copy(jar, appendPath(path, files[i].getName()), files[i], preprocess, extra);
代码示例来源:origin: biz.aQute.bnd/bndlib
copy(jar, appendPath(path, files[i].getName()), files[i], preprocess, extra);
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
.get(pref.getPath());
if (map != null) {
copy(jar, cpe, pref.getPath(), false);
break;
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
.get(pref.getPath());
if (map != null) {
copy(jar, cpe, pref.getPath(), false);
break;
代码示例来源:origin: biz.aQute/bndlib
Map<String,Resource> map = cpe.getDirectories().get(pref.getPath());
if (map != null) {
copy(jar, cpe, pref.getPath(), false);
代码示例来源:origin: biz.aQute.bnd/bndlib
Map<String,Resource> map = cpe.getDirectories().get(pref.getPath());
if (map != null) {
copy(jar, cpe, pref.getPath(), false);
代码示例来源:origin: biz.aQute.bnd/bnd
Map<String,Resource> map = cpe.getDirectories().get(pref.getPath());
if (map != null) {
copy(jar, cpe, pref.getPath(), false);
内容来源于网络,如有侵权,请联系作者删除!