Changeset 15492
- Timestamp:
- 11/30/20 08:22:35 (2 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/JarPathname.java
r15490 r15492 85 85 } 86 86 87 /** Transform a reference to a nested Jar to an entry */ 88 public static JarPathname archiveAsEntry(JarPathname p) { 89 JarPathname result = new JarPathname(); 90 result = (JarPathname)result.copyFrom(p); 91 92 LispObject jars = result.getJars(); 93 jars = jars.nreverse(); 94 Pathname entry = (Pathname)jars.car(); 95 jars = jars.cdr().nreverse(); 96 97 result 98 .setDevice(jars) 99 .setDirectory(entry.getDirectory()) 100 .setName(entry.getName()) 101 .setType(entry.getType()); 102 103 return result; 104 } 105 106 87 107 /** Transform an entry in a jar to a reference as a jar */ 88 108 public static JarPathname createFromEntry(JarPathname p) { -
trunk/abcl/src/org/armedbear/lisp/Pathname.java
r15457 r15492 1294 1294 } 1295 1295 result.setDevice(new Cons(rootDevice, result.getDevice().cdr())); 1296 1297 if (result.getDirectory().equals(NIL) 1298 && (!result.getName().equals(NIL) 1299 || !result.getType().equals(NIL))) { 1300 result.setDirectory(NIL.push(Keyword.ABSOLUTE)); 1301 } 1302 1296 1303 // sanity check that the pathname has been constructed correctly 1297 1298 1304 result.validateComponents(); 1299 1305 return result; … … 1794 1800 result.setType(d.getType()); 1795 1801 } 1802 1803 // JAR-PATHNAME directories are always absolute 1804 if ((result instanceof JarPathname) 1805 && (!result.getName().equals(NIL) 1806 || !result.getType().equals(NIL)) 1807 && result.getDirectory().equals(NIL)) { 1808 result.setDirectory(NIL.push(Keyword.ABSOLUTE)); 1809 } 1810 1796 1811 // CLtLv2 MERGE-PATHNAMES 1797 1812 -
trunk/abcl/src/org/armedbear/lisp/ZipCache.java
r15491 r15492 508 508 509 509 static ArchiveStream getArchiveStreamFromFile(JarPathname p) { 510 JarPathname root = new JarPathname(); 511 root.setDevice(new Cons(p.getRootJar(), NIL)); 512 Pathname nextJar = (Pathname)p.getJars().cdr().car(); 513 ArchiveFile rootArchiveFile = (ArchiveFile)getArchiveFile(root); 514 515 JarPathname innerArchive = new JarPathname(); 516 517 LispObject jars = list(p.getRootJar(), nextJar); 518 innerArchive.setDevice(jars); 519 520 JarPathname innerArchiveAsEntry = new JarPathname(); 521 innerArchiveAsEntry 522 .setDevice(new Cons(root, NIL)) 523 .setDirectory(nextJar.getDirectory()) 524 .setName(nextJar.getName()) 525 .setType(nextJar.getType()); 526 527 ZipEntry entry = rootArchiveFile.getEntry(innerArchiveAsEntry); 528 if (entry == null) { 529 return null; 530 } 531 InputStream inputStream = rootArchiveFile.getEntryAsInputStream(innerArchiveAsEntry); 532 if (inputStream == null) { 533 return null; 534 } 535 ArchiveStream result = new ArchiveStream(inputStream, innerArchive, entry); 536 return result; 537 } 510 JarPathname innerArchiveAsEntry = JarPathname.archiveAsEntry(p); 511 JarPathname root = new JarPathname(); 512 root = (JarPathname)root.copyFrom(innerArchiveAsEntry); 513 root 514 .setDirectory(NIL) 515 .setName(NIL) 516 .setType(NIL) 517 .setVersion(Keyword.NEWEST); 538 518 539 519 ArchiveFile rootArchiveFile = (ArchiveFile)getArchiveFile(root); 520 ZipEntry entry = rootArchiveFile.getEntry(innerArchiveAsEntry); 521 if (entry == null) { 522 return null; 523 } 524 InputStream inputStream = rootArchiveFile.getEntryAsInputStream(innerArchiveAsEntry); 525 if (inputStream == null) { 526 return null; 527 } 528 ArchiveStream result = new ArchiveStream(inputStream, p, entry); 529 return result; 530 } 540 531 541 532 public static Archive getArchiveURL(JarPathname jar) {
Note: See TracChangeset
for help on using the changeset viewer.