streamlet-examples/JarInfo.java
branchv_0
changeset 75 ecbf6504915c
parent 74 a2aa84f310a5
equal deleted inserted replaced
74:a2aa84f310a5 75:ecbf6504915c
    44 	// TODO: more OOP, move to separate repository, proper Maven project, clean-up, stabilize API
    44 	// TODO: more OOP, move to separate repository, proper Maven project, clean-up, stabilize API
    45 	public static final String ATTRIBUTE_COMMENT = "comment";
    45 	public static final String ATTRIBUTE_COMMENT = "comment";
    46 	public static final String ATTRIBUTE_ENTRIES = "entries";
    46 	public static final String ATTRIBUTE_ENTRIES = "entries";
    47 	public static final String ATTRIBUTE_MAIN_CLASS = "main_class";
    47 	public static final String ATTRIBUTE_MAIN_CLASS = "main_class";
    48 
    48 
    49 	private List<String> jarAttributes = new LinkedList<>();
    49 	private final List<String> jarAttributes = new LinkedList<>();
    50 
    50 
    51 	public static void main(String[] args) throws IOException {
    51 	public static void main(String[] args) throws IOException {
    52 		JarInfo s = new JarInfo();
    52 		JarInfo s = new JarInfo();
    53 		int status = s.run();
    53 		int status = s.run();
    54 		System.exit(status);
    54 		System.exit(status);
    88 	@Override
    88 	@Override
    89 	protected List<Object> getOutputAttributes() {
    89 	protected List<Object> getOutputAttributes() {
    90 		List<Object> result = new LinkedList<>();
    90 		List<Object> result = new LinkedList<>();
    91 
    91 
    92 		try {
    92 		try {
    93 			JarFile jar = new JarFile(new File(currentFile));
    93 			JarFile jar = new JarFile(new File(getCurrentFile()));
    94 
    94 
    95 			for (String attributeName : jarAttributes) {
    95 			for (String attributeName : jarAttributes) {
    96 				switch (attributeName) {
    96 				switch (attributeName) {
    97 					case ATTRIBUTE_COMMENT:
    97 					case ATTRIBUTE_COMMENT:
    98 						result.add(jar.getComment());
    98 						result.add(jar.getComment());