Changeset 15401


Ignore:
Timestamp:
10/10/20 21:43:38 (2 years ago)
Author:
Mark Evenson
Message:

Use PathnameURL namespace for URL things

Remove Pathname.jarSeparator in favor of PathnameURL.JAR_URI_SUFFIX.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Pathname.java

    r15400 r15401  
    261261    }
    262262
    263     static final Symbol SCHEME = internKeyword("SCHEME");
    264     static final Symbol AUTHORITY = internKeyword("AUTHORITY");
    265     static final Symbol QUERY = internKeyword("QUERY");
    266     static final Symbol FRAGMENT = internKeyword("FRAGMENT");
    267 
    268     static final private String jarSeparator = "!/";
    269 
    270263  private static final Pathname init(String s) {
    271264      Pathname result = new Pathname();
     
    316309       
    317310        // A JAR file
    318         if (s.startsWith("jar:") && s.endsWith(jarSeparator)) {
     311        if (s.startsWith(PathnameJar.JAR_URI_PREFIX)
     312            && s.endsWith(PathnameJar.JAR_URI_SUFFIX)) {
    319313          return (PathnameJar)PathnameJar.create(s);
    320314        }
    321315
    322316        // An entry in a JAR file
    323         final int separatorIndex = s.lastIndexOf(jarSeparator);
    324         if (separatorIndex > 0 && s.startsWith("jar:")) {
     317        final int separatorIndex = s.lastIndexOf(PathnameJar.JAR_URI_SUFFIX);
     318        if (separatorIndex > 0 && s.startsWith(PathnameJar.JAR_URI_PREFIX)) {
    325319          return (PathnameJar)PathnameJar.create(s);
    326320        }
     
    504498                             || isURL());
    505499            if (isURL()) {
    506                 LispObject scheme = Symbol.GETF.execute(getHost(), SCHEME, NIL);
    507                 LispObject authority = Symbol.GETF.execute(getHost(), AUTHORITY, NIL);
     500                LispObject scheme = Symbol.GETF.execute(getHost(), PathnameURL.SCHEME, NIL);
     501                LispObject authority = Symbol.GETF.execute(getHost(), PathnameURL.AUTHORITY, NIL);
    508502                Debug.assertTrue(scheme != NIL);
    509503                sb.append(scheme.getStringValue());
     
    21652159    if (this instanceof PathnameURL) {
    21662160      PathnameURL p = (PathnameURL) this;
    2167       LispObject scheme = Symbol.GETF.execute(p.getHost(), SCHEME, NIL);
     2161      LispObject scheme = Symbol.GETF.execute(p.getHost(), PathnameURL.SCHEME, NIL);
    21682162      if (scheme.equals(NIL)
    21692163          || p.getHost().getStringValue().equals("file")) {
  • trunk/abcl/src/org/armedbear/lisp/PathnameJar.java

    r15398 r15401  
    7878
    7979  static public LispObject createFromFile(String s) {
    80     return PathnameJar.create("jar:file:" + s + JAR_URI_SUFFIX);
     80    return PathnameJar.create(JAR_URI_PREFIX + "file:" + s + JAR_URI_SUFFIX);
    8181  }
    8282
    8383  static public LispObject createEntryFromFile(String jar, String entry) {
    84     return PathnameJar.create("jar:file:" + jar + JAR_URI_SUFFIX + entry);
     84    return PathnameJar.create(JAR_URI_PREFIX + "file:" + jar + JAR_URI_SUFFIX + entry);
    8585  }
    8686
     
    9999    int i = s.lastIndexOf(JAR_URI_PREFIX);
    100100    if (i == -1) {
    101       parse_error("Failed to find any occurence of 'jar:' prefixes:" + s);
     101      parse_error("Failed to find any occurence of '" + JAR_URI_PREFIX + "' prefixes:" + s);
    102102      return null; // not reached
    103103    }
  • trunk/abcl/src/org/armedbear/lisp/PathnameURL.java

    r15400 r15401  
    7575      parse_error("Cannot form a PATHNAME-URL from " + s);
    7676    }
    77     if (s.startsWith("jar:")) {
     77    if (s.startsWith(PathnameJar.JAR_URI_PREFIX)) {
    7878      return PathnameJar.create(s);
    7979    }
Note: See TracChangeset for help on using the changeset viewer.