jaroslav@672: /** jaroslav@672: * Back 2 Browser Bytecode Translator jaroslav@672: * Copyright (C) 2012 Jaroslav Tulach jaroslav@672: * jaroslav@672: * This program is free software: you can redistribute it and/or modify jaroslav@672: * it under the terms of the GNU General Public License as published by jaroslav@672: * the Free Software Foundation, version 2 of the License. jaroslav@672: * jaroslav@672: * This program is distributed in the hope that it will be useful, jaroslav@672: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@672: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@672: * GNU General Public License for more details. jaroslav@672: * jaroslav@672: * You should have received a copy of the GNU General Public License jaroslav@672: * along with this program. Look for COPYING file in the top folder. jaroslav@672: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@672: */ jaroslav@672: package org.apidesign.vm4brwsr; jaroslav@672: jaroslav@672: import java.io.IOException; jaroslav@672: import java.io.InputStream; jaroslav@672: import org.apidesign.bck2brwsr.emul.lang.ManifestInputStream; jaroslav@672: jaroslav@672: /** jaroslav@672: * jaroslav@672: * @author Jaroslav Tulach jaroslav@672: */ jaroslav@702: final class ParseMan extends ManifestInputStream { jaroslav@672: private String cp; jaroslav@702: private String mc; jaroslav@672: jaroslav@702: public ParseMan(InputStream is) throws IOException { jaroslav@672: super(is); jaroslav@672: readAttributes(new byte[512]); jaroslav@672: } jaroslav@672: jaroslav@672: @Override jaroslav@672: protected String putValue(String key, String value) { jaroslav@672: if ("Class-Path".equals(key)) { jaroslav@672: cp = value; jaroslav@672: } jaroslav@702: if ("Main-Class".equals(key)) { jaroslav@702: mc = value; jaroslav@702: } jaroslav@672: return null; jaroslav@672: } jaroslav@702: jaroslav@702: String getMainClass() { jaroslav@702: return mc; jaroslav@702: } jaroslav@672: jaroslav@672: @Override jaroslav@672: public String toString() { jaroslav@672: return cp; jaroslav@672: } jaroslav@672: jaroslav@672: }