Permalink
Browse files

Fix #252 by URI escaping the characters in the URI

  • Loading branch information...
ndw committed Feb 9, 2017
1 parent 42ddce9 commit 6b286b1a50a093cde14d0230808d1f62a0070061
Showing with 19 additions and 21 deletions.
  1. +19 −21 src/main/java/com/xmlcalabash/extensions/Unzip.java
@@ -1,27 +1,7 @@
package com.xmlcalabash.extensions;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URI;
import java.util.GregorianCalendar;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import com.xmlcalabash.core.XMLCalabash;
import net.sf.saxon.s9api.QName;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.XdmNode;
import org.xml.sax.InputSource;
import com.xmlcalabash.core.XProcConstants;
import com.xmlcalabash.core.XProcException;
import com.xmlcalabash.core.XProcRuntime;
@@ -32,6 +12,24 @@
import com.xmlcalabash.runtime.XAtomicStep;
import com.xmlcalabash.util.Base64;
import com.xmlcalabash.util.TreeWriter;
import net.sf.saxon.s9api.QName;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.XdmNode;
import org.xml.sax.InputSource;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URLEncoder;
import java.util.GregorianCalendar;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/**
*
@@ -180,7 +178,7 @@ void unzip(DatatypeFactory dfactory, String systemId, InputStream stream) throws
// There's no point giving the file the URI of the pipeline document.
// This formulation is parallel to the jar scheme.
URI zipURI = URI.create("zip:" + zipFn + "!" + entry.getName());
URI zipURI = URI.create("zip:" + zipFn + "!" + URLEncoder.encode(entry.getName(), "UTF-8"));
tree.startDocument(zipURI);
tree.addStartElement(XProcConstants.c_data);

0 comments on commit 6b286b1

Please sign in to comment.