Examples of ZipReader


Examples of br.net.woodstock.rockframework.core.util.ZipReader

  private void addClassFromZip(final URL url) throws IOException, URISyntaxException {
    URI uri = Resources.getURI(url);
    File file = new File(uri);
    InputStream inputStream = new FileInputStream(file);
    ZipReader reader = new ZipReader(inputStream);
    Collection<String> files = reader.getFiles();
    if (files != null) {
      for (String s : files) {
        if (this.isValidClass(s)) {
          Class clazz = this.getClassFromFile(s);
          if ((clazz != null) && (this.isAcceptable(clazz))) {
View Full Code Here

Examples of br.net.woodstock.rockframework.util.ZipReader

    }
  }

  private void addClassFromJar(final URL url) throws IOException, URISyntaxException {
    URI uri = ClassLoaderUtils.getURI(url);
    ZipReader reader = new ZipReader(uri.getPath());
    Collection<String> files = reader.getFiles();
    if (files != null) {
      for (String file : files) {
        if (this.isValidClass(file)) {
          Class clazz = this.getClassFromFile(file);
          if ((clazz != null) && (this.isAcceptable(clazz))) {
View Full Code Here

Examples of br.net.woodstock.rockframework.util.ZipReader

  private void addClassFromZip(final URL url) throws IOException, URISyntaxException {
    URI uri = ClassLoaderUtils.getURI(url);
    File file = new File(uri);
    InputStream inputStream = new FileInputStream(file);
    ZipReader reader = new ZipReader(inputStream);
    Collection<String> files = reader.getFiles();
    if (files != null) {
      for (String s : files) {
        if (this.isValidClass(s)) {
          Class clazz = this.getClassFromFile(s);
          if ((clazz != null) && (this.isAcceptable(clazz))) {
View Full Code Here

Examples of br.net.woodstock.rockframework.util.ZipReader

  private void addClassFromZip(final URL url) throws IOException, URISyntaxException {
    URI uri = ClassLoaderUtils.getURI(url);
    File file = new File(uri);
    InputStream inputStream = new FileInputStream(file);
    ZipReader reader = new ZipReader(inputStream);
    Collection<String> files = reader.getFiles();
    if (files != null) {
      for (String s : files) {
        if (this.isValidClass(s)) {
          Class clazz = this.getClassFromFile(s);
          if ((clazz != null) && (this.isAcceptable(clazz))) {
View Full Code Here

Examples of datasoul.util.ZipReader

    public void openFile(String filename) {

        try{
            InputStream is = null;
            ZipReader zip = null;

            if (filename.endsWith(".servicelist")){
                is = new FileInputStream(filename);
                zip = new ZipReader(null, 1);
            }else{
                zip = new ZipReader(filename, DatasoulMainForm.FILE_FORMAT_VERSION);
                is = zip.getMainInputStream();
            }

            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

            //Using factory get an instance of document builder
            DocumentBuilder db = dbf.newDocumentBuilder();

            //parse using builder to get DOM representation of the XML file
            Document dom = db.parse(is);

            //node = dom.getDocumentElement().getChildNodes().item(0);
            Node node = dom.getElementsByTagName("ServiceListTable").item(0);

            this.readObject(node, zip);

            if (filename.endsWith(".servicelist")){
                is.close();
            }else{
                zip.close();
            }
        }catch (Exception e){
            ShowDialog.showReadFileError(filename, e);
        }
View Full Code Here

Examples of datasoul.util.ZipReader

        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
       
        //Using factory get an instance of document builder
        DocumentBuilder db = dbf.newDocumentBuilder();

        ZipReader zip;
        Document dom;

        // Open the file
        if (filename.endsWith(".template")){
            // Older version
            zip = new ZipReader(null, 1);
            FileInputStream fis = new FileInputStream(filename);
            GZIPInputStream zis = null;
            try{
                zis = new GZIPInputStream(fis);
            }catch(IOException e){
                zis = null;
            }
            //parse using builder to get DOM representation of the XML file
            if (zis != null){
                // file in GZIP format
                dom = db.parse(zis);
            }else{
                // uncompressed file
                dom = db.parse(filename);
            }

        }else{
            // Newer format, zip
            zip = new ZipReader(filename, DatasoulMainForm.FILE_FORMAT_VERSION);
            dom = db.parse(zip.getMainInputStream());
        }
       
        Node node = dom.getElementsByTagName("DisplayTemplate").item(0);

        this.readObject(node, zip);
       
        // Close the input stream
        zip.close();

        // upgrade from older versions
       
        // version up to 1.2 had fixed resolution at 640x480
        if (getDatasoulFileVersion() < 1){
View Full Code Here

Examples of datasoul.util.ZipReader

        this.targetContent = template.getTargetContentIdx();
    }

    public DisplayTemplateMetadata (String filename) throws Exception{
        this.filename = filename;
        ZipReader zip = new ZipReader(filename, DatasoulMainForm.FILE_FORMAT_VERSION);
        loadFromFile(zip);
        zip.close();
    }
View Full Code Here

Examples of datasoul.util.ZipReader

    }

    public BufferedImage getMiniImage(){
        BufferedImage ret = null;
        try{
            ZipReader zip = new ZipReader(filename, DatasoulMainForm.FILE_FORMAT_VERSION);
            ret = ImageIO.read(zip.getInputStream(this.exampleImageName));
            zip.close();
        }catch(Exception e){
            e.printStackTrace();
        }
        return ret;
    }
View Full Code Here

Examples of pt.opensoft.io.ZipReader

  public Reader getReader (int i) throws IOException {
    return new InputStreamReader(getInputStream(i), SystemParameters.DEFAULT_ENCODING);
  }

  public ZipReader getZipReader (int i) throws IOException {
    return new ZipReader(getInputStream(i));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.