Examples of Attributes


Examples of java.util.jar.Attributes

    Object getAttribute(Name attrName)
        throws FileSystemException
    {
        try
        {
            final Attributes attr = getAttributes();
            final String value = attr.getValue(attrName);
            return value;
        }
        catch (IOException ioe)
        {
            throw new FileSystemException(attrName.toString(), ioe);
View Full Code Here

Examples of java.util.jar.Attributes

    {
        if (attributes == null)
        {
            if (entry == null)
            {
                attributes = new Attributes(1);
            }
            else
            {
                attributes = ((JarEntry) entry).getAttributes();
                if (attributes == null)
                {
                    attributes = new Attributes(1);
                }
            }
        }

        return attributes;
View Full Code Here

Examples of java.util.jar.Attributes

  String specTitle = null, specVersion = null, specVendor = null;
  String implTitle = null, implVersion = null, implVendor = null;
  String sealed = null;
  URL sealBase = null;

  Attributes attr = man.getAttributes(path);
  if (attr != null) {
      specTitle   = attr.getValue(Name.SPECIFICATION_TITLE);
      specVersion = attr.getValue(Name.SPECIFICATION_VERSION);
      specVendor  = attr.getValue(Name.SPECIFICATION_VENDOR);
      implTitle   = attr.getValue(Name.IMPLEMENTATION_TITLE);
      implVersion = attr.getValue(Name.IMPLEMENTATION_VERSION);
      implVendor  = attr.getValue(Name.IMPLEMENTATION_VENDOR);
      sealed      = attr.getValue(Name.SEALED);
  }
  attr = man.getMainAttributes();
  if (attr != null) {
      if (specTitle == null) {
    specTitle = attr.getValue(Name.SPECIFICATION_TITLE);
      }
      if (specVersion == null) {
    specVersion = attr.getValue(Name.SPECIFICATION_VERSION);
      }
      if (specVendor == null) {
    specVendor = attr.getValue(Name.SPECIFICATION_VENDOR);
      }
      if (implTitle == null) {
    implTitle = attr.getValue(Name.IMPLEMENTATION_TITLE);
      }
      if (implVersion == null) {
    implVersion = attr.getValue(Name.IMPLEMENTATION_VERSION);
      }
      if (implVendor == null) {
    implVendor = attr.getValue(Name.IMPLEMENTATION_VENDOR);
      }
      if (sealed == null) {
    sealed = attr.getValue(Name.SEALED);
      }
  }
  if ("true".equalsIgnoreCase(sealed)) {
      sealBase = url;
  }
View Full Code Here

Examples of java.util.jar.Attributes

     * Returns true if the specified package name is sealed according to the
     * given manifest.
     */
    private boolean isSealed(String name, Manifest man) {
  String path = name.replace('.', '/').concat("/");
  Attributes attr = man.getAttributes(path);
  String sealed = null;
  if (attr != null) {
      sealed = attr.getValue(Name.SEALED);
  }
  if (sealed == null) {
      if ((attr = man.getMainAttributes()) != null) {
    sealed = attr.getValue(Name.SEALED);
      }
  }
  return "true".equalsIgnoreCase(sealed);
    }
View Full Code Here

Examples of java.util.jar.Attributes

      Connection conn = cf.createConnection();
      assertNotNull(conn);
      ConnectionMetaData meta = conn.getMetaData();
     
      // Compare the value from ConnectionMetaData and MANIFEST.MF
      Attributes attrs = manifest.getMainAttributes();
     
      log.info("META--> " + meta.getJMSMajorVersion());
      log.info("META--> " + meta.getJMSMinorVersion());
      log.info("META--> " + meta.getJMSProviderName());
      log.info("META--> " + meta.getJMSVersion());
      log.info("META--> " + meta.getProviderMajorVersion());
      log.info("META--> " + meta.getProviderMinorVersion());
      log.info("META--> " + meta.getProviderVersion());
     
      Iterator itr = attrs.entrySet().iterator();
      while (itr.hasNext()) {
         Object item = itr.next();
         System.out.println("MANIFEST--> " + item + " : " + attrs.get(item));
      }
     
      assertEquals(attrs.getValue("Implementation-Title"), meta.getJMSProviderName());
      String ver = attrs.getValue("Implementation-Version");
      assertTrue(-1 != ver.indexOf(meta.getProviderVersion()));
   }
View Full Code Here

Examples of java.util.jar.Attributes

    }

    private static void buildManifest(HashMap<String, String> argMap)
            throws Exception {
        Manifest m = new Manifest();
        Attributes a = m.getMainAttributes();
        a.put(Attributes.Name.MANIFEST_VERSION, "1.0");
        //a.put("Built-By", "manningr"); // argMap.get(BUILT_BY_KEY)
        a.put("Application-Version", argMap.get(VERSION_KEY));
        a.put(Attributes.Name.CLASS_PATH,
                "lib/antlr-2.7.5H3.jar "
                + "lib/commons-cli.jar "
                + "lib/commons-logging-1.0.4.jar "
                + "lib/forms.jar "
                + "lib/fw.jar "
                + "lib/hibernate3.jar "
                + "lib/jxl.jar "
                + "lib/log4j.jar "
                + "lib/nanoxml-2.1.jar "
                + "lib/openide.jar  "
                + "lib/openide-loaders.jar "
                + "lib/org-netbeans-modules-editor-fold.jar "
                + "lib/org-netbeans-modules-editor.jar "
                + "lib/org-netbeans-modules-editor-lib.jar "
                + "lib/org-netbeans-modules-editor-util.jar "
                + "lib/syntax.jar ");
        a.put(Attributes.Name.MAIN_CLASS,
              "net.sourceforge.squirrel_sql.client.Main");
        m.write(System.out);
    }
View Full Code Here

Examples of javax.naming.directory.Attributes

   * @param result the search result
   */
  // GHH 20080326 - added fetching of DN of result, for directories that
  // do not include it as an attribute
  private List<?> getRow(SearchResult result) throws TranslatorException {
    Attributes attrs = result.getAttributes();
    String resultDN = result.getNameInNamespace(); // added GHH 20080326
    ArrayList<Column> attributeList = searchDetails.getElementList();
    List<Object> row = new ArrayList<Object>(attributeList.size());
   
    for (Column col : attributeList) {
View Full Code Here

Examples of javax.naming.directory.Attributes

    List<ColumnReference> insertElementList = ((Insert)command).getColumns();
    List<Expression> insertValueList = ((ExpressionValueSource)((Insert)command).getValueSource()).getValues();
    // create a new attribute list with case ignored in attribute
    // names
    Attributes insertAttrs = new BasicAttributes(true);
    Attribute insertAttr; // what we will use to populate the attribute list
    ColumnReference insertElement;
    String nameInsertElement;
    Object insertValue;
    String distinguishedName = null;
    // The IInsert interface uses separate List objects for
    // the element names and values to be inserted, limiting
    // the potential for code reuse in reading them (since all
    // other interfaces use ICriteria-based mechanisms for such
    // input).
    for (int i=0; i < insertElementList.size(); i++) {
      insertElement = insertElementList.get(i);
      // call utility class to get NameInSource/Name of element
      nameInsertElement = getNameFromElement(insertElement);
      // special handling for DN attribute - use it to set
      // distinguishedName value.
      if (nameInsertElement.toUpperCase().equals("DN")) {  //$NON-NLS-1$
        insertValue = ((Literal)insertValueList.get(i)).getValue();
        if (insertValue == null) {
                final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.columnSourceNameDNNullError"); //$NON-NLS-1$
          throw new TranslatorException(msg);
        }
        if (!(insertValue instanceof java.lang.String)) {
                final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.columnSourceNameDNTypeError"); //$NON-NLS-1$
          throw new TranslatorException(msg);
        }
        distinguishedName = (String)insertValue;
      }
      // for other attributes specified in the insert command,
      // create a new
      else {
        insertAttr = new BasicAttribute(nameInsertElement);
        insertValue = ((Literal)insertValueList.get(i)).getValue();
        insertAttr.add(insertValue);
        insertAttrs.put(insertAttr);
      }
    }
    // if the DN is not specified, we don't know enough to attempt
    // the LDAP add operation, so throw an exception
    if (distinguishedName == null) {
View Full Code Here

Examples of javax.naming.directory.Attributes

    List<Inet6Address>  result = new ArrayList<Inet6Address>();

    try{     
      DirContext context = getInitialDirContext();
     
      Attributes attrs = context.getAttributes( host, new String[]{ "AAAA" });
     
      if ( attrs != null ){
     
        Attribute attr = attrs.get( "aaaa" );
     
        if ( attr != null ){
         
          NamingEnumeration values = attr.getAll();
     
View Full Code Here

Examples of javax.naming.directory.Attributes

          }
         
        }
      } else {

        Attributes a = ctx.getAttributes(dn, new String[] { "uniquemember" });
        Attribute memberAttr = a.get("uniquemember");
       
        if (memberAttr != null) {
          for (NamingEnumeration de=memberAttr.getAll(); de.hasMore(); ) {
            String val = (String)de.next();
            String name = val.substring(val.indexOf("=")+1, val.indexOf(",")).trim();
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.