use of org.hibernate.jpa.boot.archive.spi.ArchiveEntry in project wildfly by wildfly.
the class VirtualFileSystemArchiveDescriptor method processVirtualFile.
private void processVirtualFile(VirtualFile virtualFile, String path, ArchiveContext archiveContext) {
if (path == null) {
path = "";
} else {
if (!path.endsWith("/'")) {
path = path + "/";
}
}
for (VirtualFile child : virtualFile.getChildren()) {
if (!child.exists()) {
// should never happen conceptually, but...
continue;
}
if (child.isDirectory()) {
processVirtualFile(child, path + child.getName(), archiveContext);
continue;
}
final String name = child.getPathName();
final String relativeName = path + child.getName();
final InputStreamAccess inputStreamAccess = new VirtualFileInputStreamAccess(name, child);
final ArchiveEntry entry = new ArchiveEntry() {
@Override
public String getName() {
return name;
}
@Override
public String getNameWithinArchive() {
return relativeName;
}
@Override
public InputStreamAccess getStreamAccess() {
return inputStreamAccess;
}
};
archiveContext.obtainArchiveEntryHandler(entry).handleEntry(entry, archiveContext);
}
}
Aggregations