Changeset 15405
- Timestamp:
- 10/10/20 21:43:43 (3 years ago)
- Location:
- trunk/abcl
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/Pathname.java
r15404 r15405 166 166 } 167 167 168 void copyFrom(Pathname p) { 168 /** 169 * 170 */ 171 Pathname copyFrom(Pathname p) { 169 172 if (p.host != NIL) { 170 173 if (p.host instanceof SimpleString) { … … 183 186 } else if (p.getDevice() instanceof Cons) { 184 187 LispObject jars = p.getDevice(); 185 jars = jars.nreverse(); 186 device = NIL; 188 setDevice(NIL); 189 PathnameURL root = PathnameURL.create((Pathname)jars.car()); 190 device = device.push(root); 191 jars = jars.cdr(); 187 192 while (jars.car() != NIL) { 188 Pathname jar = (Pathname) Pathname.create(((Pathname)jars.car()).getNamestring()); 193 Pathname jar 194 = (Pathname) Pathname.create(((Pathname)jars.car()).getNamestring()); 189 195 device = device.push(jar); 190 196 jars = jars.cdr(); 191 197 } 198 device.nreverse(); 192 199 } else if (p.device instanceof Symbol) { // When is this the case? 193 200 device = p.device; … … 241 248 } 242 249 } 250 return this; 243 251 } 244 252 … … 1218 1226 p.validateDirectory(true); 1219 1227 1220 // TODO: need to check for downcast to PathnameURL as well1228 // ??? need to check for downcast to PathnameURL as well? 1221 1229 // Possibly downcast type to PathnameJar 1222 1230 if (p.getDevice() instanceof Cons) { 1223 1231 PathnameJar result = new PathnameJar(); 1224 ncoerce(p, result); 1232 result 1233 .copyFrom(p) 1234 .setDevice(PathnameJar.makeJarDeviceFrom(p)); 1235 1225 1236 // sanity check that the pathname has been constructed correctly 1226 1237 result.validateComponents(); … … 1827 1838 } 1828 1839 1829 public static finalLispObject truename(Pathname pathname) {1840 public static LispObject truename(Pathname pathname) { 1830 1841 return truename(pathname, false); 1831 1842 } 1832 1843 1833 public static finalLispObject truename(LispObject arg) {1844 public static LispObject truename(LispObject arg) { 1834 1845 return truename(arg, false); 1835 1846 } 1836 1847 1837 public static finalLispObject truename(LispObject arg, boolean errorIfDoesNotExist) {1848 public static LispObject truename(LispObject arg, boolean errorIfDoesNotExist) { 1838 1849 final Pathname pathname = coerceToPathname(arg); 1839 1850 return truename(pathname, errorIfDoesNotExist); … … 1844 1855 * LispError if there are logical problems with the input. 1845 1856 */ 1846 public static finalLispObject truename(Pathname pathname,1847 1857 public static LispObject truename(Pathname pathname, 1858 boolean errorIfDoesNotExist) { 1848 1859 if (pathname == null || pathname.equals(NIL)) { 1849 1860 return doTruenameExit(pathname, errorIfDoesNotExist); … … 2136 2147 } 2137 2148 2138 /** @return The representation of this pathname suitable for 2139 * referencing an entry in a Zip/JAR file 2149 /** @return The representation of the DIRECTORY/NAME/TYPE elements 2150 * of pathname suitable for referencing an entry in a Zip/JAR file. 2151 * 2152 * This representation is always a relative path. 2140 2153 */ 2141 2154 protected String asEntryPath() { -
trunk/abcl/src/org/armedbear/lisp/PathnameJar.java
r15404 r15405 58 58 protected PathnameJar() {} 59 59 60 public static Pathname create() {60 public static PathnameJar create() { 61 61 return new PathnameJar(); 62 62 } … … 66 66 } 67 67 68 public static LispObjectcreateFromPathname(Pathname p) {68 public static PathnameJar createFromPathname(Pathname p) { 69 69 if (p instanceof PathnameURL) { 70 70 return PathnameJar.create(JAR_URI_PREFIX … … 77 77 + JAR_URI_SUFFIX); 78 78 } else { 79 return p;80 } 81 } 82 83 static public LispObjectcreateFromFile(String s) {79 return (PathnameJar)p; 80 } 81 } 82 83 static public PathnameJar createFromFile(String s) { 84 84 return PathnameJar.create(JAR_URI_PREFIX + "file:" + s + JAR_URI_SUFFIX); 85 85 } 86 86 87 static public LispObjectcreateEntryFromFile(String jar, String entry) {87 static public PathnameJar createEntryFromFile(String jar, String entry) { 88 88 return PathnameJar.create(JAR_URI_PREFIX + "file:" + jar + JAR_URI_SUFFIX + entry); 89 89 } 90 90 91 static public LispObjectcreateEntryFromJar(PathnameJar jar, String entry) {91 static public PathnameJar createEntryFromJar(PathnameJar jar, String entry) { 92 92 if (jar.isArchiveEntry()) { 93 return simple_error("Failed to create the entry ~a in ~a", entry, jar); 93 simple_error("Failed to create the entry ~a in ~a", entry, jar); 94 return (PathnameJar)UNREACHED; 94 95 } 95 96 return PathnameJar.create(jar.getNamestring() + entry); … … 159 160 } 160 161 161 static public LispObjectcreate(String s) {162 static public PathnameJar create(String s) { 162 163 if (!s.startsWith(JAR_URI_PREFIX)) { 163 return parse_error("Cannot create a PATHNAME-JAR from namestring: " + s); 164 parse_error("Cannot create a PATHNAME-JAR from namestring: " + s); 165 return (PathnameJar)UNREACHED; 164 166 } 165 167 … … 167 169 168 170 if (contents == null) { 169 return parse_error("Couldn't parse PATHNAME-JAR from namestring: " + s); 171 parse_error("Couldn't parse PATHNAME-JAR from namestring: " + s); 172 return (PathnameJar)UNREACHED; 170 173 } 171 174 172 175 PathnameJar result = new PathnameJar(); 173 176 174 LispObject rootPathname = Pathname.create(contents.get(0)); 177 // Normalize the root jar to be a URL 178 String rootNamestring = contents.get(0); 179 if (!isValidURL(rootNamestring)) { 180 rootNamestring = "file:" + rootNamestring; 181 } 182 183 PathnameURL rootPathname = (PathnameURL)PathnameURL.create(rootNamestring); 175 184 176 185 LispObject jars = NIL; … … 207 216 208 217 LispObject jars = getDevice(); 218 219 LispObject rootJar = getRootJar(); 220 if (!(rootJar instanceof PathnameURL)) { 221 return type_error("The first element in the DEVICE component of a JAR-PATHNAME is not of expected type", 222 rootJar, 223 Symbol.URL_PATHNAME); 224 } 225 226 jars = jars.cdr(); 227 209 228 while (!jars.car().equals(NIL)) { 210 229 LispObject jar = jars.car(); … … 221 240 return T; 222 241 } 223 224 242 225 243 public String getNamestring() { 226 244 StringBuffer sb = new StringBuffer(); 227 245 228 LispObject jars = get Device();246 LispObject jars = getJars(); 229 247 230 248 if (jars.equals(NIL) || jars.equals(Keyword.UNSPECIFIC)) { 231 type_error("JAR-PATHNAME has bad DEVICE",232 jars,233 list(Symbol.NOT,234 list(Symbol.OR,235 list(Symbol.EQL, NIL),236 list(Symbol.EQL, Keyword.UNSPECIFIC))));237 return (String)UNREACHED;249 // type_error("JAR-PATHNAME has bad DEVICE", 250 // jars, 251 // list(Symbol.NOT, 252 // list(Symbol.OR, 253 // list(Symbol.EQL, NIL), 254 // list(Symbol.EQL, Keyword.UNSPECIFIC)))); 255 return null; 238 256 } 239 257 … … 242 260 } 243 261 244 LispObject root = jars.car();262 LispObject root = getRootJar(); 245 263 246 264 if (root instanceof PathnameURL) { … … 259 277 } 260 278 261 if (jars.length() > 1) { 262 LispObject innerJars = jars.cdr(); 263 while (innerJars.car() != NIL) { 264 Pathname jar = (Pathname)innerJars.car(); 265 Pathname p = new Pathname(); 266 p.copyFrom(jar) 267 .setDevice(NIL); 268 String ns = p.getNamestring(); 269 sb.append(ns) 270 .append(JAR_URI_SUFFIX); 271 innerJars = innerJars.cdr(); 272 } 279 LispObject innerJars = jars.cdr(); 280 while (innerJars.car() != NIL) { 281 Pathname jar = (Pathname)innerJars.car(); 282 Pathname p = new Pathname(); 283 p.copyFrom(jar) 284 .setDevice(NIL); 285 String ns = p.getNamestring(); 286 sb.append(ns) 287 .append(JAR_URI_SUFFIX); 288 innerJars = innerJars.cdr(); 273 289 } 274 290 … … 316 332 } 317 333 318 public static final LispObject truename(PathnameJar pathname, 319 boolean errorIfDoesNotExist) { 320 PathnameJar result = pathname; 321 322 LispObject jars = pathname.getJars(); 323 Pathname rootJar = (Pathname) pathname.getRootJar(); 324 LispObject enclosingJars = jars.cdr(); 325 326 // if (!rootJar.isLocalFile()) { 327 328 // } 329 334 public static LispObject truename(Pathname pathname, 335 boolean errorIfDoesNotExist) { 336 if (!(pathname instanceof PathnameJar)) { 337 return PathnameURL.truename(pathname, errorIfDoesNotExist); 338 } 330 339 PathnameJar p = new PathnameJar(); 331 340 p.copyFrom(pathname); 332 p.setDevice(new Cons(rootJar, enclosingJars)); 341 342 PathnameURL rootJar = (PathnameURL) p.getRootJar(); 343 if (rootJar.isLocalFile()) { 344 LispObject trueRootJar = PathnameURL.truename(rootJar, errorIfDoesNotExist); 345 if (trueRootJar.equals(NIL)) { 346 return Pathname.doTruenameExit(rootJar, errorIfDoesNotExist); 347 } 348 LispObject otherJars = p.getJars().cdr(); 349 p.setDevice(new Cons(trueRootJar, otherJars)); 350 } 333 351 334 352 if (!p.isArchiveEntry()) { … … 396 414 } 397 415 398 /** List the contents of the directory*/416 /** List the contents of a directory within a JAR archive */ 399 417 static public LispObject listDirectory(PathnameJar pathname) { 400 418 String directory = pathname.asEntryPath(); … … 404 422 } 405 423 406 // if (pathname.getDevice().cdr() instanceof Cons) {407 // return error(new FileError("Unimplemented directory listing of JAR within JAR.", pathname));408 // }409 410 424 if (directory.length() == 0) { 411 425 directory = "/*"; … … 419 433 420 434 Pathname wildcard = (Pathname)Pathname.create(directory); 421 // String wildcard = new SimpleString(directory);422 // directories in a a jar aren't marked with a suffixed slash423 // SimpleString wildcardDirectory = new SimpleString(directory + "/");424 435 425 436 LispObject result = NIL; 426 //LispObject matches;427 437 428 438 Iterator<Map.Entry<PathnameJar,ZipEntry>> iterator = ZipCache.getEntriesIterator(pathname); … … 430 440 Map.Entry<PathnameJar,ZipEntry> e = iterator.next(); 431 441 PathnameJar entry = e.getKey(); 432 // PathnameJar jarPath = (PathnameJar)PathnameJar.create(e.getKey());433 // ZipEntry entry = e.getValue();434 435 // if (entryName.endsWith("/")) {436 // matches = Symbol.PATHNAME_MATCH_P437 // .execute(new SimpleString(entryName), wildcardDirectory);438 // } else {439 // matches = Symbol.PATHNAME_MATCH_P.440 // execute(new SimpleString(entryName), wildcard);441 // }442 442 if (!Symbol.PATHNAME_MATCH_P.execute(entry, wildcard).equals(NIL)) { 443 443 result = result.push(entry); … … 469 469 return new FileError("Not a wild pathname.", pathname); 470 470 } 471 if (!((PathnameJar)pathname).getJars().cdr().equals(NIL)) {472 return simple_error("Unimplemented match on contents of inner jars"); // FIXME473 }474 471 475 472 PathnameJar jarPathname = new PathnameJar(); 476 jarPathname.copyFrom(pathname);477 473 jarPathname 474 .copyFrom(pathname) 478 475 .setDirectory(NIL) 479 476 .setName(NIL) … … 499 496 } 500 497 501 // FIXME implement recursive jars502 // if (pathname.getDevice().cdr() instanceof Cons) {503 // ZipFile outerJar = ZipCache.get((Pathname)pathname.getDevice().car());504 // String entryPath = ((Pathname)pathname.getDevice().cdr().car()).getNamestring(); //???505 // if (entryPath.startsWith("/")) {506 // entryPath = entryPath.substring(1);507 // }508 // ZipEntry entry = outerJar.getEntry(entryPath);509 // InputStream inputStream = null;510 // try {511 // inputStream = outerJar.getInputStream(entry);512 // } catch (IOException e) {513 // return new FileError("Failed to read zip input stream inside zip.",514 // pathname);515 // }516 // ZipInputStream zipInputStream517 // = new ZipInputStream(inputStream);518 519 // try {520 // while ((entry = zipInputStream.getNextEntry()) != null) {521 // String entryName = "/" + entry.getName();522 // LispObject matches = Symbol.PATHNAME_MATCH_P523 // .execute(new SimpleString(entryName), wildcard);524 525 // if (!matches.equals(NIL)) {526 // String namestring = new String(pathname.getNamestring());527 // namestring = namestring.substring(0, namestring.lastIndexOf("!/") + 2)528 // + entry.getName();529 // Pathname p = (Pathname)Pathname.create(namestring);530 // result = new Cons(p, result);531 // }532 // }533 // } catch (IOException e) {534 // return new FileError("Failed to seek through zip inputstream inside zip.",535 // pathname);536 // }537 // } else {538 // }539 498 return result; 540 499 } … … 555 514 return 0; 556 515 } 516 517 static PathnameJar joinEntry(PathnameJar root, Pathname entry) { 518 PathnameJar result = new PathnameJar(); 519 result 520 .copyFrom(root) 521 .setDirectory(entry.getDirectory()) 522 .setName(entry.getName()) 523 .setType(entry.getType()); // ??? VERSION 524 return result; 525 } 526 527 static LispObject makeDeviceFrom(PathnameJar p) { 528 PathnameJar result = new PathnameJar(); 529 result.copyFrom(p); 530 Pathname rootJar = (Pathname)result.getRootJar(); 531 if (!rootJar.equals(NIL) 532 && (rootJar instanceof Pathname)) { 533 rootJar = (Pathname)PathnameURL.createFromFile(rootJar); 534 result.setDevice(new Cons(rootJar, result.getJars().cdr())); 535 } 536 return result; 537 } 538 539 static LispObject makeJarDeviceFrom(Pathname p) { 540 PathnameJar result = new PathnameJar(); 541 result.copyFrom(p); 542 Pathname rootJar = (Pathname)result.getRootJar(); 543 // Ensure 544 if (!rootJar.equals(NIL) 545 && (rootJar instanceof Pathname)) { 546 rootJar = (Pathname)PathnameURL.createFromFile(rootJar); 547 result.setDevice(new Cons(rootJar, result.getJars().cdr())); 548 } 549 return result.getDevice(); 550 } 557 551 } -
trunk/abcl/src/org/armedbear/lisp/PathnameURL.java
r15404 r15405 59 59 } 60 60 61 public static PathnameURL create(Pathname p) { 62 return (PathnameURL)createFromFile((Pathname)p); 63 } 64 61 65 public static PathnameURL create(PathnameURL p) { 62 66 return (PathnameURL) PathnameURL.create(p.getNamestring()); … … 71 75 } 72 76 73 public static LispObject create(String s) { 77 public static LispObject createFromFile(Pathname p) { 78 String ns = "file:" + p.getNamestring(); 79 return create(ns); 80 } 81 82 public static PathnameURL create(String s) { 74 83 if (!isValidURL(s)) { 75 84 parse_error("Cannot form a PATHNAME-URL from " + s); … … 84 93 url = new URL(s); 85 94 } catch (MalformedURLException e) { 86 return parse_error("Malformed URL in namestring '" + s + "': " + e.toString()); 95 parse_error("Malformed URL in namestring '" + s + "': " + e.toString()); 96 return (PathnameURL) UNREACHED; 87 97 } 88 98 String scheme = url.getProtocol(); … … 92 102 uri = new URI(s); 93 103 } catch (URISyntaxException ex) { 94 return parse_error("Improper URI syntax for " 95 + "'" + url.toString() + "'" 96 + ": " + ex.toString()); 104 parse_error("Improper URI syntax for " 105 + "'" + url.toString() + "'" 106 + ": " + ex.toString()); 107 return (PathnameURL)UNREACHED; 97 108 } 98 109 … … 103 114 uriPath = uri.getSchemeSpecificPart(); 104 115 if (uriPath == null || uriPath.equals("")) { 105 return parse_error("The namestring URI has no path: " + uri); 116 parse_error("The namestring URI has no path: " + uri); 117 return (PathnameURL)UNREACHED; 106 118 } 107 119 } … … 126 138 uri = url.toURI().normalize(); 127 139 } catch (URISyntaxException e) { 128 return parse_error("Couldn't form URI from " 129 + "'" + url + "'" 130 + " because: " + e); 140 parse_error("Couldn't form URI from " 141 + "'" + url + "'" 142 + " because: " + e); 143 return (PathnameURL)UNREACHED; 131 144 } 132 145 String authority = uri.getAuthority(); … … 265 278 } 266 279 280 public static LispObject truename(Pathname p, boolean errorIfDoesNotExist) { 281 PathnameURL pathnameURL = (PathnameURL)PathnameURL.createFromFile(p); 282 return PathnameURL.truename(pathnameURL, errorIfDoesNotExist); 283 } 284 267 285 public static LispObject truename(PathnameURL p, boolean errorIfDoesNotExist) { 268 286 if (p.getHost().equals(NIL) 269 || Symbol.GETF.execute(p.getHost(), PathnameURL.SCHEME, NIL).equals("file")) { 270 return Pathname.truename((Pathname)p, errorIfDoesNotExist); 287 || Symbol.GETF.execute(p.getHost(), PathnameURL.SCHEME, NIL) 288 .equals("file")) { 289 return Pathname.truename(p, errorIfDoesNotExist); 271 290 } 272 291 -
trunk/abcl/src/org/armedbear/lisp/ZipCache.java
r15400 r15405 211 211 extends Archive 212 212 { 213 InputStream source; 213 ZipInputStream source; 214 215 // TODO wrap in a weak reference to allow JVM to possibly reclaim memory 216 LinkedHashMap<PathnameJar, ByteArrayOutputStream> contents 217 = new LinkedHashMap<PathnameJar, ByteArrayOutputStream>(); 214 218 215 219 public InputStream getEntryAsInputStream(PathnameJar entry) { 220 ByteArrayOutputStream bytes = contents.get(entry); 221 if (bytes != null) { 222 return new ByteArrayInputStream(bytes.toByteArray()); 223 } 216 224 return null; 217 225 } 218 226 227 boolean populated = false; 228 219 229 public ZipEntry getEntry(PathnameJar entry) { 220 return null; 221 } 222 223 void populateAllEntries() {} 230 if (!populated) { 231 populateAllEntries(); 232 } 233 ZipEntry result = entries.get(entry); 234 return result; 235 } 236 237 void populateAllEntries() { 238 if (populated) { 239 return; 240 } 241 ZipEntry entry; 242 try { 243 while ((entry = source.getNextEntry()) != null) { 244 String name = entry.getName(); 245 PathnameJar entryPathname 246 = (PathnameJar)PathnameJar.createEntryFromJar(root, name); 247 entries.put(entryPathname, entry); 248 ByteArrayOutputStream bytes 249 = readEntry(source); 250 contents.put(entryPathname, bytes); 251 } 252 populated = true; 253 } catch (IOException e) { 254 simple_error("Failed to read entries from zip archive", root); 255 } 256 } 224 257 225 258 void close () { … … 323 356 try { 324 357 result = file.getInputStream(zipEntry); 325 } catch (IOException e) {} 358 } catch (IOException e) {} // FIXME how to signal a meaningful error? 326 359 327 360 return result; … … 336 369 } 337 370 } 338 339 371 340 372 static boolean cacheEnabled = true; … … 368 400 } 369 401 370 371 402 static ZipEntry getZipEntry(PathnameJar archiveEntry) { 372 403 PathnameJar archiveJar = archiveEntry.getArchive(); … … 376 407 } 377 408 409 // ??? we assume that DIRECTORY, NAME, and TYPE components are NIL 378 410 synchronized public static Archive getArchive(PathnameJar jar) { 379 Archive cached= cache.get(jar);380 if ( cached!= null) {381 return cached;411 Archive result = cache.get(jar); 412 if (result != null) { 413 return result; 382 414 } 383 415 … … 392 424 return getArchiveFile(jar); 393 425 } else { 394 PathnameJar rootPathname = (PathnameJar)PathnameJar.createFromPathname(rootJar); 395 396 Archive current = ZipCache.getArchive(rootPathname); 397 398 // FIXME 399 //while (innerJars.car() != NIL) { 400 // TODO Finish me! 401 // Pathname next = (Pathname)innerJars.car(); 402 // String entryPath = next.asEntryPath(); 403 // InputStream source; 404 // if (current instanceof ArchiveFile) { 405 // ArchiveFile zipFile = ((ArchiveFile)current).get(); 406 // ZipEntry entry = zipFile.getEntry(entryPath); 407 // source = zipFile.getInputStream(entry); 408 // ArchiveStream stream = new ArchiveStream(); 409 // stream.source = source; 410 // } 411 // } 412 413 simple_error("Currently unimplemented recursive archive: ~a" , jar); 414 return (Archive)UNREACHED; 426 PathnameJar root = new PathnameJar(); 427 root.setDevice(new Cons(rootJar, NIL)); 428 ArchiveFile rootArchiveFile = (ArchiveFile)getArchiveFile(root); 429 430 PathnameJar innerArchive = new PathnameJar(); 431 Pathname nextJar = (Pathname)innerJars.car(); 432 LispObject jars = list(rootJar, nextJar); 433 innerArchive.setDevice(jars); 434 435 PathnameJar innerArchiveAsEntry = new PathnameJar(); 436 innerArchiveAsEntry 437 .setDevice(new Cons(rootJar, NIL)) 438 .setDirectory(nextJar.getDirectory()) 439 .setName(nextJar.getName()) 440 .setType(nextJar.getType()); 441 442 ZipEntry entry = rootArchiveFile.getEntry(innerArchiveAsEntry); 443 if (entry == null) { 444 return null; 445 } 446 InputStream inputStream = rootArchiveFile.getEntryAsInputStream(innerArchiveAsEntry); 447 if (inputStream == null) { 448 return null; 449 } 450 ArchiveStream stream = new ArchiveStream(); 451 stream.source = new ZipInputStream(inputStream); 452 stream.root = innerArchive; 453 stream.lastModified = entry.getTime(); 454 result = stream; 455 cache.put(innerArchive, result); 456 457 innerJars = innerJars.cdr(); 458 while (innerJars.car() != NIL) { 459 simple_error("Currently unimplemented nested zip archive of depth greater than two: ~a" , jar); 460 return (Archive)UNREACHED; 461 } 462 463 return result; 415 464 } 416 465 } -
trunk/abcl/src/org/armedbear/lisp/probe_file.java
r15395 r15405 52 52 public LispObject execute(LispObject arg) 53 53 { 54 if (arg == null || arg.equals(NIL)) { 55 return NIL; 56 } 54 57 Pathname p = coerceToPathname(arg); 58 if (p.isWild()) { 59 return error(new FileError("Cannot find the TRUENAME for a wild pathname.", 60 p)); 61 } 55 62 // TODO: refactor Pathname{,Jar,URL}.truename() to be non-static? 56 63 if (p instanceof PathnameJar) { 57 return PathnameJar.truename( (PathnameJar)p, false);64 return PathnameJar.truename(p, false); 58 65 } else if (p instanceof PathnameURL) { 59 return PathnameURL.truename( (PathnameURL)p, false);66 return PathnameURL.truename(p, false); 60 67 } else { 61 68 return Pathname.truename(p, false); … … 77 84 { 78 85 Pathname p = coerceToPathname(arg); 86 if (p.isWild()) { 87 return error(new FileError("Cannot find the TRUENAME for a wild pathname.", 88 p)); 89 } 90 79 91 // TODO: refactor Pathname{,Jar,URL}.truename() to be non-static? 80 92 if (p instanceof PathnameJar) { 81 return PathnameJar.truename( (PathnameJar)p, true);93 return PathnameJar.truename(p, true); 82 94 } else if (p instanceof PathnameURL) { 83 return PathnameURL.truename( (PathnameURL)p, true);95 return PathnameURL.truename(p, true); 84 96 } else { 85 97 return Pathname.truename(p, true); -
trunk/abcl/test/src/org/armedbear/lisp/ZipTest.java
r15397 r15405 20 20 // FIXME These need to be created as part of executing the tests 21 21 String zipFile = "/Users/evenson/work/abcl/dist/abcl-contrib.jar"; 22 // created via 23 // (require :abcl-contrib) 24 // (asdf:load-system :asdf-jar) 25 // (asdf-jar:package :cl-ppcre) 26 String nestedJarFile = "/var/tmp/cl-ppcre-all-2.1.1.jar"; 22 27 PathnameJar zip; 23 String nestedJarFile = "/var/tmp/cl-ppcre-2.1.1.jar";24 28 PathnameJar nestedJar; 25 29 … … 61 65 } 62 66 67 @Test 68 public void getNestedJar() { 69 String nestedNamestring = "jar:jar:file:/var/tmp/cl-ppcre-all-2.1.1.jar!/cl-ppcre/packages.abcl!/"; 70 PathnameJar nested = (PathnameJar)PathnameJar.create(nestedNamestring); 71 ZipCache.Archive archive = ZipCache.getArchive(nested); 72 assertTrue("Able to retrieve nested jar archive", 73 !archive.equals(null)); 74 } 63 75 64 @Test 65 public void nestedJar() { 66 String nestedNamestring = "jar:jar:file:/var/tmp/cl-ppcre-2.1.1.jar!/cl-ppcre/packages.abcl!/__loader__._"; 67 Pathname nested = (Pathname)PathnameJar.create(nestedNamestring); 76 // @Test 77 public void getNestedJarEntry() { 78 String nestedNamestring = "jar:jar:file:/var/tmp/cl-ppcre-all-2.1.1.jar!/cl-ppcre/packages.abcl!/__loader__._"; 68 79 } 69 80 70 81 71 82
Note: See TracChangeset
for help on using the changeset viewer.