1 /* 2 * Copyright 2008 University Corporation for Advanced Internet Development, Inc. 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 package org.opensaml.util.resource; 18 19 import java.io.InputStream; 20 21 /** Filter that operates over a resource. Filters may perform any logic on the incoming stream. */ 22 public interface ResourceFilter { 23 24 /** 25 * Applies this filter to the given stream. 26 * 27 * @param resource Resource to which the filter should apply. 28 * 29 * @return filtered stream 30 * 31 * @throws ResourceException thrown is there if a problem applying the filter 32 */ 33 public InputStream applyFilter(InputStream resource) throws ResourceException; 34 }