blob: 7aeb68cec65412f108f9e6c3a7c0ac5bd84fffeb [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * reserved comment block
3 * DO NOT REMOVE OR ALTER!
4 */
5/*
6 * Copyright 1999-2004 The Apache Software Foundation.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 */
21
22package com.sun.org.apache.xml.internal.security.utils.resolver.implementations;
23
24import java.io.FileInputStream;
25import java.io.FileNotFoundException;
26import java.io.IOException;
27import java.io.InputStream;
28
29import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput;
30import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi;
31import org.w3c.dom.Attr;
32
33/**
34 *
35 * @author $Author: raul $
36 */
37
38public class ResolverAnonymous extends ResourceResolverSpi {
39 /** {@link java.util.logging} logging facility */
40 static java.util.logging.Logger log =
41 java.util.logging.Logger.getLogger(
42 ResolverAnonymous.class.getName());
43
44 private XMLSignatureInput _input = null;
45
46 /**
47 * @param filename
48 * @throws FileNotFoundException
49 * @throws IOException
50 */
51 public ResolverAnonymous(String filename) throws FileNotFoundException, IOException {
52 this._input = new XMLSignatureInput(new FileInputStream(filename));
53 }
54
55 /**
56 * @param is
57 */
58 public ResolverAnonymous(InputStream is) {
59 this._input = new XMLSignatureInput(is);
60 }
61
62 /** @inheritDoc */
63 public XMLSignatureInput engineResolve(Attr uri, String BaseURI) {
64 return this._input;
65 }
66
67 /**
68 * @inheritDoc
69 */
70 public boolean engineCanResolve(Attr uri, String BaseURI) {
71 if (uri == null) {
72 return true;
73 }
74 return false;
75 }
76
77 /** @inheritDoc */
78 public String[] engineGetPropertyKeys() {
79 return new String[0];
80 }
81}