本文整理汇总了Java中org.springframework.boot.loader.archive.Archive.Entry类的典型用法代码示例。如果您正苦于以下问题:Java Entry类的具体用法?Java Entry怎么用?Java Entry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Entry类属于org.springframework.boot.loader.archive.Archive包,在下文中一共展示了Entry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addNestedEntries
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
private void addNestedEntries(List<Archive> lib) {
// The parent archive might have "BOOT-INF/lib/" and "BOOT-INF/classes/"
// directories, meaning we are running from an executable JAR. We add nested
// entries from there with low priority (i.e. at end).
try {
lib.addAll(this.parent.getNestedArchives(new EntryFilter() {
@Override
public boolean matches(Entry entry) {
if (entry.isDirectory()) {
return entry.getName().startsWith(JarLauncher.BOOT_INF_CLASSES);
}
return entry.getName().startsWith(JarLauncher.BOOT_INF_LIB);
}
}));
}
catch (IOException ex) {
// Ignore
}
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:22,代码来源:PropertiesLauncher.java
示例2: getFilteredArchive
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Test
public void getFilteredArchive() throws Exception {
Archive filteredArchive = this.archive
.getFilteredArchive(new Archive.EntryRenameFilter() {
@Override
public AsciiBytes apply(AsciiBytes entryName, Entry entry) {
if (entryName.toString().equals("1.dat")) {
return entryName;
}
return null;
}
});
Map<String, Entry> entries = getEntriesMap(filteredArchive);
assertThat(entries.size(), equalTo(1));
URLClassLoader classLoader = new URLClassLoader(
new URL[] { filteredArchive.getUrl() });
assertThat(classLoader.getResourceAsStream("1.dat").read(), equalTo(1));
assertThat(classLoader.getResourceAsStream("2.dat"), nullValue());
classLoader.close();
}
示例3: getNestedArchives
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Override
public List<Archive> getNestedArchives(final EntryFilter filter)
throws IOException {
return this.parent.getNestedArchives(new EntryFilter() {
@Override
public boolean matches(Entry entry) {
return FilteredArchive.this.filter.matches(entry)
&& filter.matches(entry);
}
});
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:PropertiesLauncher.java
示例4: getClassPathArchives
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Override
protected List<Archive> getClassPathArchives() throws Exception {
List<Archive> archives = new ArrayList<Archive>(
this.archive.getNestedArchives(new EntryFilter() {
@Override
public boolean matches(Entry entry) {
return isNestedArchive(entry);
}
}));
postProcessClassPathArchives(archives);
return archives;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:ExecutableArchiveLauncher.java
示例5: getNestedArchive
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Test
public void getNestedArchive() throws Exception {
Entry entry = getEntriesMap(this.archive).get("nested.jar");
Archive nested = this.archive.getNestedArchive(entry);
assertThat(nested.getUrl().toString())
.isEqualTo("jar:" + this.rootFolder.toURI() + "nested.jar!/");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:ExplodedArchiveTests.java
示例6: nestedDirArchive
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Test
public void nestedDirArchive() throws Exception {
Entry entry = getEntriesMap(this.archive).get("d/");
Archive nested = this.archive.getNestedArchive(entry);
Map<String, Entry> nestedEntries = getEntriesMap(nested);
assertThat(nestedEntries.size()).isEqualTo(1);
assertThat(nested.getUrl().toString())
.isEqualTo("file:" + this.rootFolder.toURI().getPath() + "d/");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:ExplodedArchiveTests.java
示例7: getNonRecursiveManifest
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Test
public void getNonRecursiveManifest() throws Exception {
ExplodedArchive archive = new ExplodedArchive(
new File("src/test/resources/root"));
assertThat(archive.getManifest()).isNotNull();
Map<String, Archive.Entry> entries = getEntriesMap(archive);
assertThat(entries.size()).isEqualTo(4);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:ExplodedArchiveTests.java
示例8: getNonRecursiveManifestEvenIfNonRecursive
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Test
public void getNonRecursiveManifestEvenIfNonRecursive() throws Exception {
ExplodedArchive archive = new ExplodedArchive(new File("src/test/resources/root"),
false);
assertThat(archive.getManifest()).isNotNull();
Map<String, Archive.Entry> entries = getEntriesMap(archive);
assertThat(entries.size()).isEqualTo(3);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:ExplodedArchiveTests.java
示例9: getEntriesMap
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
private Map<String, Archive.Entry> getEntriesMap(Archive archive) {
Map<String, Archive.Entry> entries = new HashMap<String, Archive.Entry>();
for (Archive.Entry entry : archive) {
entries.put(entry.getName().toString(), entry);
}
return entries;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:ExplodedArchiveTests.java
示例10: getNestedArchive
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Test
public void getNestedArchive() throws Exception {
Entry entry = getEntriesMap(this.archive).get("nested.jar");
Archive nested = this.archive.getNestedArchive(entry);
assertThat(nested.getUrl().toString())
.isEqualTo("jar:" + this.rootJarFileUrl + "!/nested.jar!/");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:JarFileArchiveTests.java
示例11: getNestedUnpackedArchive
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Test
public void getNestedUnpackedArchive() throws Exception {
setup(true);
Entry entry = getEntriesMap(this.archive).get("nested.jar");
Archive nested = this.archive.getNestedArchive(entry);
assertThat(nested.getUrl().toString()).startsWith("file:");
assertThat(nested.getUrl().toString()).endsWith("/nested.jar");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:JarFileArchiveTests.java
示例12: unpackedLocationsAreUniquePerArchive
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Test
public void unpackedLocationsAreUniquePerArchive() throws Exception {
setup(true);
Entry entry = getEntriesMap(this.archive).get("nested.jar");
URL firstNested = this.archive.getNestedArchive(entry).getUrl();
setup(true);
entry = getEntriesMap(this.archive).get("nested.jar");
URL secondNested = this.archive.getNestedArchive(entry).getUrl();
assertThat(secondNested).isNotEqualTo(firstNested);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:JarFileArchiveTests.java
示例13: getClassPathArchives
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Override
protected List<Archive> getClassPathArchives() throws Exception {
List<Archive> archives = new ArrayList<Archive>(
this.archive.getNestedArchives(new EntryFilter() {
@Override
public boolean matches(Entry entry) {
return isNestedArchive(entry);
}
}));
postProcessClassPathArchives(archives);
return archives;
}
示例14: getNestedArchive
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Test
public void getNestedArchive() throws Exception {
Entry entry = getEntriesMap(this.archive).get("nested.jar");
Archive nested = this.archive.getNestedArchive(entry);
assertThat(nested.getUrl().toString(),
equalTo("jar:" + this.rootFolder.toURI() + "nested.jar!/"));
}
示例15: nestedDirArchive
import org.springframework.boot.loader.archive.Archive.Entry; //导入依赖的package包/类
@Test
public void nestedDirArchive() throws Exception {
Entry entry = getEntriesMap(this.archive).get("d/");
Archive nested = this.archive.getNestedArchive(entry);
Map<String, Entry> nestedEntries = getEntriesMap(nested);
assertThat(nestedEntries.size(), equalTo(1));
assertThat(nested.getUrl().toString(),
equalTo("file:" + this.rootFolder.toURI().getPath() + "d/"));
}