01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.rproxy.rewriter.obscure;
06:
07: import com.sun.portal.rewriter.util.StringHelper;
08: import com.sun.portal.rewriter.util.crypto.CryptoHelper;
09: import com.sun.portal.rewriter.util.uri.PageSpec;
10: import com.sun.portal.rproxy.rewriter.SRAPJSFunctionSpec;
11: import com.sun.portal.rproxy.rewriter.util.SRAPConfigManager;
12: import com.sun.portal.rproxy.rewriter.util.uri.SRAPGatewayURI;
13:
14: public final class ObscureJSFunctionSpec extends SRAPJSFunctionSpec {
15: public ObscureJSFunctionSpec(final SRAPGatewayURI aGatewayURL) {
16: super (aGatewayURL);
17: }// constructor()
18:
19: protected final String makeExpressionFunction(
20: final PageSpec aPageSpec, final String aDefinition) {
21: if (SRAPConfigManager.isNot2ObscureURI(aPageSpec.getBaseURI()
22: .getFullFileURI())) {
23: return super .makeExpressionFunction(aPageSpec, aDefinition);
24: }
25:
26: return putGatewayURI(StringHelper
27: .searchAndReplace(
28: aDefinition,
29: new String[][] {
30: {
31: INSERT_PAGE_NETWORK_URI_PATTERN,
32: CryptoHelper.encode(aPageSpec
33: .getBaseURI()
34: .getNetworkURI()) },
35: {
36: INSERT_PAGE_BASE_URI_PATTERN,
37: CryptoHelper.encode(aPageSpec
38: .getBaseURI()
39: .getBaseHREF()) } }));
40: }// makeExpressionFunction()
41: }// class ObscureJSFunctionSpec
|