Package java.util.jar

Examples of java.util.jar.JarException


     * @throws IllegalArgumentException If entry is not present in the jar.
     */
    private void extractEntry(String name, File file)
            throws IOException, IllegalArgumentException {
        if (_jar == null) {
            throw new JarException("Jar file is closed.");
        }

        JarEntry jarEntry = _jar.getJarEntry(name);
        if (jarEntry == null) {
            _logger.log(Level.FINE, _strings.get("invalidArchiveEntry", name, _jar.getName()));
View Full Code Here


        if (_extractedEntries.isEmpty()) {
            _logger.log(Level.FINER, _strings.get("noArchiveEntryToUpdate", _archive.getName()));
            return;
        }
        if (_jar == null) {
            throw new JarException("Jar file is not in open state, jar path.");
        }
        File tempJarFile = null, jarFile = null;
        FileOutputStream fos = null;
        JarOutputStream jos = null;
        boolean success = false;
View Full Code Here

   
    /**
     * @tests java.util.jar.JarException#JarException(java.lang.String)
     */
    public void test_ConstructorLjava_lang_String1() throws Exception {
         assertEquals("Jar Exception", new JarException("Jar Exception").getMessage());
    }
View Full Code Here

    /**
     * @tests java.util.jar.JarException#JarException()
     */
    public void test_Constructor_void() throws Exception {
        new JarException();
    }
View Full Code Here

            } finally {
                MCPatcherUtils.close(jar);
            }

            if (version == null) {
                exception = new JarException("Could not determine version of " + minecraftJar.getPath());
                return CORRUPT_JAR;
            }
            origMD5 = getOrigMD5(minecraftJar.getParentFile(), version);
            if (!haveMetaInf) {
                return MODDED_JAR;
View Full Code Here

                      "Unexpected version number: " + version
                      + ". Continue (but may fail later)");
      }
    catch (IOException ioe)
      {
        throw new JarException("Signature file MUST start with a "
                               + version_header + ": " + ioe.getMessage());
      }
    read_attributes(attr, br);

    // read individual sections
View Full Code Here

        String value = expectHeader(version_header, br);
        attr.putValue(MANIFEST_VERSION, value);
      }
    catch (IOException ioe)
      {
        throw new JarException("Manifest should start with a " + version_header
                               + ": " + ioe.getMessage());
      }
  }
View Full Code Here

  private static String expectHeader(String header, BufferedReader br)
      throws IOException
  {
    String s = br.readLine();
    if (s == null)
      throw new JarException("unexpected end of file");

    return expectHeader(header, br, s);
  }
View Full Code Here

        String value = readHeaderValue(value_start, br);
        attr.putValue(name, value);
      }
    catch (IndexOutOfBoundsException iobe)
      {
        throw new JarException("Manifest contains a bad header: " + s);
      }
  }
View Full Code Here

        entries.put(name, attr);
        return attr;
      }
    catch (IOException ioe)
      {
        throw new JarException("Section should start with a Name header: "
                               + ioe.getMessage());
      }
  }
View Full Code Here

TOP

Related Classes of java.util.jar.JarException

Copyright © 2018 www.massapicom. 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.