本文整理了Java中aQute.bnd.osgi.Jar.putResource()
方法的一些代码示例,展示了Jar.putResource()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jar.putResource()
方法的具体详情如下:
包路径:aQute.bnd.osgi.Jar
类名称:Jar
方法名:putResource
暂无
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
private void split(Jar original, Jar main, Jar src) {
for (Map.Entry<String, Resource> e : original.getResources()
.entrySet()) {
String path = e.getKey();
if (path.startsWith("OSGI-OPT/src/")) {
src.putResource(path.substring("OSGI-OPT/src/".length()), e.getValue());
} else {
main.putResource(path, e.getValue());
}
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
private void split(Jar original, Jar main, Jar src) {
for (Map.Entry<String, Resource> e : original.getResources()
.entrySet()) {
String path = e.getKey();
if (path.startsWith("OSGI-OPT/src/")) {
src.putResource(path.substring("OSGI-OPT/src/".length()), e.getValue());
} else {
main.putResource(path, e.getValue());
}
}
}
代码示例来源:origin: biz.aQute/bndlib
private void split(Jar original, Jar main, Jar src) {
for (Map.Entry<String,Resource> e : original.getResources().entrySet()) {
String path = e.getKey();
if (path.startsWith("OSGI-OPT/src/")) {
src.putResource(path.substring("OSGI-OPT/src/".length()), e.getValue());
} else {
main.putResource(path, e.getValue());
}
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
private void split(Jar original, Jar main, Jar src) {
for (Map.Entry<String,Resource> e : original.getResources().entrySet()) {
String path = e.getKey();
if (path.startsWith("OSGI-OPT/src/")) {
src.putResource(path.substring("OSGI-OPT/src/".length()), e.getValue());
} else {
main.putResource(path, e.getValue());
}
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
private void split(Jar original, Jar main, Jar src) {
for (Map.Entry<String,Resource> e : original.getResources().entrySet()) {
String path = e.getKey();
if (path.startsWith("OSGI-OPT/src/")) {
src.putResource(path.substring("OSGI-OPT/src/".length()), e.getValue());
} else {
main.putResource(path, e.getValue());
}
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
private void split(Jar original, Jar main, Jar src) {
for (Map.Entry<String,Resource> e : original.getResources().entrySet()) {
String path = e.getKey();
if (path.startsWith("OSGI-OPT/src/")) {
src.putResource(path.substring("OSGI-OPT/src/".length()), e.getValue());
} else {
main.putResource(path, e.getValue());
}
}
}
代码示例来源:origin: biz.aQute/bndlib
private void split(Jar original, Jar main, Jar src) {
for (Map.Entry<String,Resource> e : original.getResources().entrySet()) {
String path = e.getKey();
if (path.startsWith("OSGI-OPT/src/")) {
src.putResource(path.substring("OSGI-OPT/src/".length()), e.getValue());
} else {
main.putResource(path, e.getValue());
}
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
public boolean addDirectory(Map<String, Resource> directory, boolean overwrite) {
check();
boolean duplicates = false;
if (directory == null)
return false;
for (Map.Entry<String, Resource> entry : directory.entrySet()) {
duplicates |= putResource(entry.getKey(), entry.getValue(), overwrite);
}
return duplicates;
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
public boolean putResource(String path, Resource resource) {
check();
return putResource(path, resource, true);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
public boolean addDirectory(Map<String, Resource> directory, boolean overwrite) {
check();
boolean duplicates = false;
if (directory == null)
return false;
for (Map.Entry<String, Resource> entry : directory.entrySet()) {
duplicates |= putResource(entry.getKey(), entry.getValue(), overwrite);
}
return duplicates;
}
代码示例来源:origin: biz.aQute/bndlib
public static void build(Jar jar, InputStream in, long lastModified) throws IOException {
ZipInputStream jin = new ZipInputStream(in);
ZipEntry entry = jin.getNextEntry();
while (entry != null) {
if (!entry.isDirectory()) {
byte data[] = collect(jin);
jar.putResource(entry.getName(), new EmbeddedResource(data, lastModified), true);
}
entry = jin.getNextEntry();
}
IO.drain(in);
jin.close();
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
String relativePath = IO.normalizePath(baseDir.relativize(file));
putResource(relativePath, new FileResource(file, attrs), true);
return FileVisitResult.CONTINUE;
}
});
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
String relativePath = IO.normalizePath(baseDir.relativize(file));
putResource(relativePath, new FileResource(file, attrs), true);
return FileVisitResult.CONTINUE;
}
});
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
public boolean rename(String oldPath, String newPath) {
check();
Resource resource = remove(oldPath);
if (resource == null)
return false;
return putResource(newPath, resource);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
private void copyInfoResource(Jar source, Jar dest, String type) {
if (source.getResources()
.containsKey(type)
&& !dest.getResources()
.containsKey(type))
dest.putResource(type, source.getResource(type));
}
代码示例来源:origin: biz.aQute.bnd/bndlib
public boolean rename(String oldPath, String newPath) {
check();
Resource resource = remove(oldPath);
if (resource == null)
return false;
return putResource(newPath, resource);
}
代码示例来源:origin: biz.aQute/bndlib
public boolean rename(String oldPath, String newPath) {
check();
Resource resource = remove(oldPath);
if (resource == null)
return false;
return putResource(newPath, resource);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
public boolean rename(String oldPath, String newPath) {
check();
Resource resource = remove(oldPath);
if (resource == null)
return false;
return putResource(newPath, resource);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
private void copy(Jar jar, String path, Resource resource, Map<String, String> extra) {
jar.putResource(path, resource);
if (isTrue(extra.get(LIB_DIRECTIVE))) {
setProperty(BUNDLE_CLASSPATH, append(getProperty(BUNDLE_CLASSPATH, "."), path));
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
@Override
public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception {
project.prepare();
Collection<Container> runbundles = project.getRunbundles();
Jar jar = new Jar(project.getName());
jar.setDoNotTouchManifest();
for (Container container : runbundles) {
File source = container.getFile();
String path = nonCollidingPath(jar, source.getName());
jar.putResource(path, new FileResource(source));
}
return new SimpleEntry<>(jar.getName(), new JarResource(jar, true));
}
内容来源于网络,如有侵权,请联系作者删除!