KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xml > internal > security > utils > resolver > implementations > ResolverAnonymous


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 package com.sun.org.apache.xml.internal.security.utils.resolver.implementations;
19
20 import java.io.FileInputStream JavaDoc;
21 import java.io.FileNotFoundException JavaDoc;
22 import java.io.IOException JavaDoc;
23 import java.io.InputStream JavaDoc;
24
25 import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput;
26 import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi;
27 import org.w3c.dom.Attr JavaDoc;
28
29 /**
30  *
31  * @author $Author: raul $
32  */

33
34 public class ResolverAnonymous extends ResourceResolverSpi {
35    /** {@link java.util.logging} logging facility */
36     static java.util.logging.Logger JavaDoc log =
37         java.util.logging.Logger.getLogger(
38                         ResolverAnonymous.class.getName());
39
40    private XMLSignatureInput _input = null;
41
42    /**
43     * @param filename
44      * @throws FileNotFoundException
45      * @throws IOException
46      */

47    public ResolverAnonymous(String JavaDoc filename) throws FileNotFoundException JavaDoc, IOException JavaDoc {
48       this._input = new XMLSignatureInput(new FileInputStream JavaDoc(filename));
49    }
50
51    /**
52     * @param is
53      */

54    public ResolverAnonymous(InputStream JavaDoc is) {
55       this._input = new XMLSignatureInput(is);
56    }
57
58    /** @inheritDoc */
59    public XMLSignatureInput engineResolve(Attr JavaDoc uri, String JavaDoc BaseURI) {
60       return this._input;
61    }
62
63    /**
64     * @inheritDoc
65     */

66    public boolean engineCanResolve(Attr JavaDoc uri, String JavaDoc BaseURI) {
67       if (uri == null) {
68          return true;
69       }
70       return false;
71    }
72
73    /** @inheritDoc */
74    public String JavaDoc[] engineGetPropertyKeys() {
75       return new String JavaDoc[0];
76    }
77 }
78
79
Popular Tags