~zorba-coders/zorba/fn_envvars

« back to all changes in this revision

Viewing changes to src/zorbatypes/URI.cpp

  • Committer: Juan Zacarias
  • Date: 2012-02-13 19:25:51 UTC
  • mfrom: (10599.1.56 zorba)
  • Revision ID: juan457@gmail.com-20120213192551-4daq70pie0c0gof1
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
    zstring tmp(uri.c_str() + 8);
100
100
    uri::decode(tmp, &filepath);
101
101
  }
 
102
  else if (uri.compare(0, 6, "file:/") == 0 && //JAVA Exception for File URIs without Authority
 
103
          ((uri.compare(7, 1, ":") == 0) || (uri.compare(7, 4, "%3A/") == 0))) 
 
104
  {
 
105
    zstring tmp(uri.c_str() + 6);
 
106
    uri::decode(tmp, &filepath);
 
107
  }
 
108
  else if (uri.compare(0, 17, "file://localhost/") == 0 && 
 
109
      ((uri.compare(18, 1, ":") == 0) || (uri.compare(18, 4, "%3A/") == 0))) 
 
110
  {
 
111
    zstring tmp(uri.c_str() + 17);
 
112
    uri::decode(tmp, &filepath);
 
113
  }
102
114
  else
103
115
#endif
104
116
    if (uri.compare(0, 8, "file:///") == 0) 
621
633
   * Authority
622
634
   * two slashes means generic URI syntax, so we get the authority
623
635
   */
624
 
  if (lTrimmedURI.compare(lIndex, 2, "//") == 0) 
 
636
  if ( (lTrimmedURI.compare(lIndex, 2, "//") == 0) ||
 
637
        // allow JAVA FILE constructs without authority, i.e.: file:/D:/myFile 
 
638
       (ZSTREQ(theScheme, "file") && (lTrimmedURI.compare(lIndex, 1, "/") == 0)))
625
639
  {
626
 
    lIndex += 2;
 
640
    if ((lTrimmedURI.compare(lIndex, 2, "//") == 0)) {
 
641
      lIndex += 2;
 
642
    }
627
643
    if (lIndex >= lTrimmedURILength)
628
644
    {
629
645
      throw XQUERY_EXCEPTION(