本文整理汇总了Java中com.sun.tools.javac.file.RelativePath.RelativeDirectory.basename方法的典型用法代码示例。如果您正苦于以下问题:Java RelativeDirectory.basename方法的具体用法?Java RelativeDirectory.basename怎么用?Java RelativeDirectory.basename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.file.RelativePath.RelativeDirectory
的用法示例。
在下文中一共展示了RelativeDirectory.basename方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildIndex
import com.sun.tools.javac.file.RelativePath.RelativeDirectory; //导入方法依赖的package包/类
private void buildIndex() throws IOException {
int entryCount = get2ByteLittleEndian(zipDir, 0);
// Add each of the files
if (entryCount > 0) {
directories = new LinkedHashMap<RelativeDirectory, DirectoryEntry>();
ArrayList<Entry> entryList = new ArrayList<Entry>();
int pos = 2;
for (int i = 0; i < entryCount; i++) {
pos = readEntry(pos, entryList, directories);
}
// Add the accumulated dirs into the same list
for (RelativeDirectory d: directories.keySet()) {
// use shared RelativeDirectory objects for parent dirs
RelativeDirectory parent = getRelativeDirectory(d.dirname().getPath());
String file = d.basename();
Entry zipFileIndexEntry = new Entry(parent, file);
zipFileIndexEntry.isDir = true;
entryList.add(zipFileIndexEntry);
}
entries = entryList.toArray(new Entry[entryList.size()]);
Arrays.sort(entries);
} else {
cleanupState();
}
}
示例2: buildIndex
import com.sun.tools.javac.file.RelativePath.RelativeDirectory; //导入方法依赖的package包/类
private void buildIndex() throws IOException {
int len = zipDir.length;
// Add each of the files
if (len > 0) {
directories = new LinkedHashMap<RelativeDirectory, DirectoryEntry>();
ArrayList<Entry> entryList = new ArrayList<Entry>();
for (int pos = 0; pos < len; ) {
pos = readEntry(pos, entryList, directories);
}
// Add the accumulated dirs into the same list
for (RelativeDirectory d: directories.keySet()) {
// use shared RelativeDirectory objects for parent dirs
RelativeDirectory parent = getRelativeDirectory(d.dirname().getPath());
String file = d.basename();
Entry zipFileIndexEntry = new Entry(parent, file);
zipFileIndexEntry.isDir = true;
entryList.add(zipFileIndexEntry);
}
entries = entryList.toArray(new Entry[entryList.size()]);
Arrays.sort(entries);
} else {
cleanupState();
}
}
示例3: buildIndex
import com.sun.tools.javac.file.RelativePath.RelativeDirectory; //导入方法依赖的package包/类
private void buildIndex() throws IOException {
int entryCount = get2ByteLittleEndian(zipDir, 0);
// Add each of the files
if (entryCount > 0) {
directories = new HashMap<RelativeDirectory, DirectoryEntry>();
ArrayList<Entry> entryList = new ArrayList<Entry>();
int pos = 2;
for (int i = 0; i < entryCount; i++) {
pos = readEntry(pos, entryList, directories);
}
// Add the accumulated dirs into the same list
for (RelativeDirectory d: directories.keySet()) {
// use shared RelativeDirectory objects for parent dirs
RelativeDirectory parent = getRelativeDirectory(d.dirname().getPath());
String file = d.basename();
Entry zipFileIndexEntry = new Entry(parent, file);
zipFileIndexEntry.isDir = true;
entryList.add(zipFileIndexEntry);
}
entries = entryList.toArray(new Entry[entryList.size()]);
Arrays.sort(entries);
} else {
cleanupState();
}
}