Changeset 15409
- Timestamp:
- 10/14/20 07:07:16 (2 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/JarPathname.java
r15408 r15409 71 71 if (p instanceof URLPathname) { 72 72 return JarPathname.create(JAR_URI_PREFIX 73 + ((URLPathname)p).getNamestringAsUR I()73 + ((URLPathname)p).getNamestringAsURL() 74 74 + JAR_URI_SUFFIX); 75 75 } else if (p instanceof Pathname) { … … 280 280 281 281 if (root instanceof URLPathname) { 282 String ns = ((URLPathname)root).getNamestringAsUR I();282 String ns = ((URLPathname)root).getNamestringAsURL(); 283 283 sb.append(JAR_URI_PREFIX) 284 284 .append(ns) -
trunk/abcl/src/org/armedbear/lisp/Pathname.java
r15408 r15409 57 57 return (JarPathname)JarPathname.create(p.getNamestring()); 58 58 } else if (p instanceof URLPathname) { 59 return (URLPathname)URLPathname.create(((URLPathname)p).getNamestringAsUR I());59 return (URLPathname)URLPathname.create(((URLPathname)p).getNamestringAsURL()); 60 60 } else { 61 61 return new Pathname(p); … … 1663 1663 } 1664 1664 1665 if (pathname.getHost() != NIL) {1666 result.setHost(p.getHost());1667 1668 result.setHost(d.getHost());1669 1670 1671 if ( pathname.getDevice() != NIL) {1665 if (pathname.getHost().equals(NIL)) { 1666 result.setHost(d.getHost()); 1667 } else { 1668 result.setHost(p.getHost()); 1669 } 1670 1671 if (!pathname.getDevice().equals(NIL)) { 1672 1672 if (!Utilities.isPlatformWindows) { 1673 1673 result.setDevice(p.getDevice()); … … 1676 1676 && p instanceof JarPathname) { 1677 1677 result.setDevice(d.getDevice()); 1678 } else { 1678 } else { 1679 1679 result.setDevice(p.getDevice()); 1680 1680 } … … 1694 1694 } 1695 1695 } else { 1696 result.setDevice(d.getDevice()); 1696 if (p.isLocalFile() && d.isLocalFile()) { 1697 result.setDevice(d.getDevice()); 1698 } else { 1699 result.setDevice(p.getDevice()); 1700 } 1697 1701 } 1698 1702 } -
trunk/abcl/src/org/armedbear/lisp/URLPathname.java
r15408 r15409 200 200 } 201 201 } 202 if (Utilities.isPlatformWindows 203 && getDevice() instanceof SimpleString) { 204 sb.append(getDevice().getStringValue()) 205 .append(":"); 206 } 202 207 String directoryNamestring = getDirectoryNamestring(); 203 208 sb.append(directoryNamestring); … … 226 231 } 227 232 228 public String getNamestringAsURI() { 233 // TODO URIEncode path components? 234 public String getNamestringAsURL() { 229 235 LispObject schemeProperty = Symbol.GETF.execute(getHost(), SCHEME, NIL); 230 236 LispObject authorityProperty = Symbol.GETF.execute(getHost(), AUTHORITY, NIL); … … 247 253 248 254 if (!directory.equals("")) { 249 path = directory + file; 255 if (Utilities.isPlatformWindows 256 && getDevice() instanceof SimpleString) { 257 path = getDevice().getStringValue() + ":" + directory + file; 258 } else { 259 path = directory + file; 260 } 250 261 } else { 251 262 path = file; … … 262 273 } 263 274 264 try { 265 URI uri = new URI(scheme, authority, path, query, fragment); 266 return uri.toString(); 267 } catch (URISyntaxException e) { 268 simple_error("Failed to construct a URI: ~a", this); 269 return (String)UNREACHED; 270 } 275 StringBuffer result = new StringBuffer(scheme); 276 result.append(":"); 277 result.append("//"); 278 if (authority != null) { 279 result.append(authority); 280 } 281 if (!path.startsWith("/")) { 282 result.append("/"); 283 } 284 result.append(path); 285 286 if (query != null) { 287 result.append("?").append(query); 288 } 289 290 if (fragment != null) { 291 result.append("#").append(fragment); 292 } 293 return result.toString(); 271 294 } 272 295 -
trunk/abcl/src/org/armedbear/lisp/abcl-contrib.lisp
r15398 r15409 57 57 ;; it would minimally need to check version information. 58 58 (ignore-errors 59 #p"jar:https://abcl.org/releases/1.7.1/abcl.jar!/")))59 (pathname "jar:https://abcl.org/releases/1.7.1/abcl.jar!/")))) 60 60 61 61 (defun flatten (list) … … 114 114 :type "jar")))) 115 115 (let ((jar (some predicate entries))) 116 (when jar116 (when (and jar (probe-file jar)) 117 117 (return-from find-jar 118 (make-pathname :device (list jar))))))))118 (make-pathname :device (list (probe-file jar))))))))) 119 119 120 120 (defun find-system-jar ()
Note: See TracChangeset
for help on using the changeset viewer.