|
1 | 1 | package co.zeroae.gate; |
2 | 2 |
|
3 | | -import co.zeroae.gate.b64.Handler; |
| 3 | +import co.zeroae.gate.mmap.Handler; |
4 | 4 | import com.amazonaws.services.lambda.runtime.Context; |
5 | 5 | import com.amazonaws.services.lambda.runtime.RequestHandler; |
6 | 6 | import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; |
@@ -52,7 +52,7 @@ public class App implements RequestHandler<APIGatewayProxyRequestEvent, APIGatew |
52 | 52 | private static final AppMetadata metadata = loadMetadata(); |
53 | 53 | private static final DocumentLRUCache cache = AWSXRay.createSegment("Cache Init", |
54 | 54 | () -> new DocumentLRUCache(App.CACHE_DIR, App.CACHE_DIR_USAGE)); |
55 | | - private static final URLStreamHandler b64Handler = new Handler(); |
| 55 | + private static final URLStreamHandler mmapHandler = new Handler(); |
56 | 56 |
|
57 | 57 | private static AppMetadata loadMetadata() { |
58 | 58 | final AppMetadata rv = new AppMetadata(); |
@@ -180,14 +180,14 @@ private void featureMapPutContent( |
180 | 180 | featureMap.put(Document.DOCUMENT_STRING_CONTENT_PARAMETER_NAME, content); |
181 | 181 | else { |
182 | 182 | // GATE FastInfosetFormat can not handle binary in the string content. |
183 | | - Handler.paths.put(contentDigest, content); |
| 183 | + Handler.paths.put(contentDigest, Base64.decode(content)); |
184 | 184 | featureMap.put( |
185 | 185 | Document.DOCUMENT_URL_PARAMETER_NAME, |
186 | | - new URL("b64", |
| 186 | + new URL("mmap", |
187 | 187 | mimeType != null ? Base64.encodeAsString(mimeType.getBytes()) : null, |
188 | 188 | 64, |
189 | 189 | contentDigest, |
190 | | - b64Handler)); |
| 190 | + mmapHandler)); |
191 | 191 | } |
192 | 192 | } |
193 | 193 |
|
|
0 commit comments