View Javadoc
1   /*
2    * Copyright 2008-2016 Brian Thomas Matthews
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 com.btmatthews.maven.plugins.ldap.mojo;
18  
19  import java.io.InputStream;
20  
21  /**
22   * Interface for LDAP directory entry sources.
23   *
24   * @author <a href="mailto:brian@btmatthews.com">Brian Matthews</a>
25   * @since 1.2.0
26   */
27  public interface Source {
28  
29      /**
30       * Open the resource or file and return the input stream. If the path is prefixed with classpath: then it is treated
31       * as a classpath resource. Otherwise, it is assumed to be a file system path.
32       *
33       * @return The input stream or {@code null} if the file or resource cannot be found.
34       */
35      InputStream open();
36  }