當前位置: 首頁>>代碼示例>>Java>>正文


Java Entry類代碼示例

本文整理匯總了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();
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:21,代碼來源:ExplodedArchiveTests.java

示例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;
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:13,代碼來源:ExecutableArchiveLauncher.java

示例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!/"));
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:8,代碼來源:ExplodedArchiveTests.java

示例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/"));
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:10,代碼來源:ExplodedArchiveTests.java


注:本文中的org.springframework.boot.loader.archive.Archive.Entry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。