01: /**
02: * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03: */package net.sourceforge.pmd;
04:
05: import java.io.IOException;
06: import java.io.InputStream;
07:
08: /**
09: * Represents a source file to be analyzed.
10: * Different implementations can get the source file
11: * from different places: the filesystem, a zip or jar file, etc.
12: */
13: public interface DataSource {
14: /**
15: * Get an InputStream on the source file.
16: *
17: * @return the InputStream reading the source file
18: * @throws IOException if the file can't be opened
19: */
20: public InputStream getInputStream() throws IOException;
21:
22: /**
23: * Return a nice version of the filename.
24: *
25: * @param shortNames true if short names are being used
26: * @param inputFileName name of a "master" file this file is relative to
27: * @return String
28: */
29: public String getNiceFileName(boolean shortNames,
30: String inputFileName);
31: }
|