deploy

16:35:04.396 INFO  jd.cli.Main - Decompiling deploy.jar
package com.sun.deploy.association;

public class Action
{
  private String description;
  private String verb;
  private String command;
  private int hashcode = 0;
  
  public Action(String paramString1, String paramString2)
  {
    verb = paramString1;
    command = paramString2;
  }
  
  public Action(String paramString1, String paramString2, String paramString3)
  {
    verb = paramString1;
    command = paramString2;
    description = paramString3;
  }
  
  public String getDescription()
  {
    return description;
  }
  
  public void setDescription(String paramString)
  {
    description = paramString;
  }
  
  public String getVerb()
  {
    return verb;
  }
  
  public void setVerb(String paramString)
  {
    verb = paramString;
  }
  
  public String getCommand()
  {
    return command;
  }
  
  public void setCommand(String paramString)
  {
    command = paramString;
  }
  
  public boolean equals(Object paramObject)
  {
    if ((paramObject instanceof Action))
    {
      Action localAction = (Action)paramObject;
      String str1 = localAction.getDescription();
      String str2 = localAction.getVerb();
      String str3 = localAction.getCommand();
      if ((description == null ? str1 == null : description.equals(str1)) && (verb == null ? str2 == null : verb.equals(str2)) && (command == null ? str3 == null : command.equals(str3))) {
        return true;
      }
    }
    return false;
  }
  
  public int hashCode()
  {
    if (hashcode != 0)
    {
      int i = 17;
      if (description != null) {
        i = 37 * i + description.hashCode();
      }
      if (verb != null) {
        i = 37 * i + verb.hashCode();
      }
      if (command != null) {
        i = 37 * i + command.hashCode();
      }
      hashcode = i;
    }
    return hashcode;
  }
  
  public String toString()
  {
    String str1 = "\r\n";
    String str2 = "";
    String str3 = "\t";
    str2 = str2.concat(str3);
    str2 = str2.concat("Description: ");
    if (description != null) {
      str2 = str2.concat(description);
    }
    str2 = str2.concat(str1);
    str2 = str2.concat(str3);
    str2 = str2.concat("Verb: ");
    if (verb != null) {
      str2 = str2.concat(verb);
    }
    str2 = str2.concat(str1);
    str2 = str2.concat(str3);
    str2 = str2.concat("Command: ");
    if (command != null) {
      str2 = str2.concat(command);
    }
    str2 = str2.concat(str1);
    return str2;
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.Action
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association;

import com.sun.deploy.association.utility.AppUtility;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Association
{
  private String name;
  private String description;
  private String mimeType;
  private List fileExtensionList;
  private String iconFileName;
  private List actionList;
  private int hashcode;
  
  public String getName()
  {
    return name;
  }
  
  public void setName(String paramString)
  {
    if (paramString == null) {
      throw new IllegalArgumentException("The given mime file name is null.");
    }
    name = paramString;
  }
  
  public String getDescription()
  {
    return description;
  }
  
  public void setDescription(String paramString)
  {
    if (paramString == null) {
      throw new IllegalArgumentException("The given description is null.");
    }
    description = paramString;
  }
  
  public String getMimeType()
  {
    return mimeType;
  }
  
  public void setMimeType(String paramString)
  {
    if (paramString == null) {
      throw new IllegalArgumentException("The given MIME type is null.");
    }
    mimeType = paramString;
  }
  
  public boolean addFileExtension(String paramString)
  {
    if (paramString == null) {
      throw new IllegalArgumentException("The given file extension is null.");
    }
    paramString = AppUtility.addDotToFileExtension(paramString);
    if (fileExtensionList == null) {
      fileExtensionList = new ArrayList();
    }
    return fileExtensionList.add(paramString);
  }
  
  public boolean removeFileExtension(String paramString)
  {
    if (paramString == null) {
      throw new IllegalArgumentException("The given file extension is null.");
    }
    paramString = AppUtility.addDotToFileExtension(paramString);
    if (fileExtensionList != null) {
      return fileExtensionList.remove(paramString);
    }
    return false;
  }
  
  public List getFileExtList()
  {
    if (fileExtensionList == null) {
      return null;
    }
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = fileExtensionList.iterator();
    while (localIterator.hasNext()) {
      localArrayList.add(localIterator.next());
    }
    return localArrayList;
  }
  
  public String getIconFileName()
  {
    return iconFileName;
  }
  
  public void setIconFileName(String paramString)
  {
    if (paramString == null) {
      throw new IllegalArgumentException("The given icon file name is null.");
    }
    iconFileName = paramString;
  }
  
  public boolean addAction(Action paramAction)
  {
    if (paramAction == null) {
      throw new IllegalArgumentException("The given action is null.");
    }
    if (paramAction.getVerb() == null) {
      throw new IllegalArgumentException("the given action object has null verb field.");
    }
    if (paramAction.getCommand() == null) {
      throw new IllegalArgumentException("the given action object has null command field.");
    }
    if (actionList == null) {
      actionList = new ArrayList();
    }
    return actionList.add(new Action(paramAction.getVerb(), paramAction.getCommand(), paramAction.getDescription()));
  }
  
  public boolean removeAction(Action paramAction)
  {
    if (paramAction == null) {
      throw new IllegalArgumentException("The given action is null.");
    }
    if ((paramAction.getVerb() == null) || (paramAction.getCommand() == null)) {
      throw new IllegalArgumentException("the given action object has null verb field or command field.");
    }
    if (actionList != null) {
      return actionList.remove(paramAction);
    }
    return false;
  }
  
  public List getActionList()
  {
    if (actionList == null) {
      return null;
    }
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = actionList.iterator();
    while (localIterator.hasNext()) {
      localArrayList.add(localIterator.next());
    }
    return localArrayList;
  }
  
  public Action getActionByVerb(String paramString)
  {
    if (actionList != null)
    {
      Iterator localIterator = actionList.iterator();
      if (localIterator != null) {
        while (localIterator.hasNext())
        {
          Action localAction = (Action)localIterator.next();
          String str = localAction.getVerb();
          if (str.equalsIgnoreCase(paramString)) {
            return localAction;
          }
        }
      }
    }
    return null;
  }
  
  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof Association)) {
      return false;
    }
    Association localAssociation = (Association)paramObject;
    String str1 = localAssociation.getDescription();
    String str2 = localAssociation.getIconFileName();
    String str3 = localAssociation.getMimeType();
    int i = (description == null ? str1 == null : description.equals(str1)) && (iconFileName == null ? str2 == null : iconFileName.equals(str2)) && (mimeType == null ? str3 == null : mimeType.equals(str3)) ? 1 : 0;
    if (i == 0) {
      return false;
    }
    List localList1 = localAssociation.getFileExtList();
    int j = 0;
    if ((fileExtensionList == null) && (localList1 == null)) {
      j = 1;
    } else if ((fileExtensionList != null) && (localList1 != null) && (fileExtensionList.containsAll(localList1)) && (localList1.containsAll(fileExtensionList))) {
      j = 1;
    }
    if (j == 0) {
      return false;
    }
    List localList2 = localAssociation.getActionList();
    boolean bool = false;
    if ((actionList == null) && (localList2 != null)) {
      bool = true;
    } else if ((actionList != null) && (localList2 != null) && (actionList.containsAll(localList2)) && (localList2.containsAll(actionList))) {
      bool = true;
    }
    return bool;
  }
  
  public int hashCode()
  {
    if (hashcode != 0)
    {
      int i = 17;
      if (name != null) {
        i = i * 37 + name.hashCode();
      }
      if (description != null) {
        i = i * 37 + description.hashCode();
      }
      if (mimeType != null) {
        i = i * 37 + mimeType.hashCode();
      }
      if (iconFileName != null) {
        i = i * 37 + iconFileName.hashCode();
      }
      if (fileExtensionList != null) {
        i = i * 37 + fileExtensionList.hashCode();
      }
      if (actionList != null) {
        i = i * 37 + actionList.hashCode();
      }
      hashcode = i;
    }
    return hashcode;
  }
  
  public String toString()
  {
    String str1 = "\r\n";
    String str2 = "";
    str2 = str2.concat("MIME File Name: ");
    if (name != null) {
      str2 = str2.concat(name);
    }
    str2 = str2.concat(str1);
    str2 = str2.concat("Description: ");
    if (description != null) {
      str2 = str2.concat(description);
    }
    str2 = str2.concat(str1);
    str2 = str2.concat("MIME Type: ");
    if (mimeType != null) {
      str2 = str2.concat(mimeType);
    }
    str2 = str2.concat(str1);
    str2 = str2.concat("Icon File: ");
    if (iconFileName != null) {
      str2 = str2.concat(iconFileName);
    }
    str2 = str2.concat(str1);
    str2 = str2.concat("File Extension: ");
    Iterator localIterator;
    if (fileExtensionList != null)
    {
      localIterator = fileExtensionList.iterator();
      if (localIterator != null) {
        while (localIterator.hasNext())
        {
          str2 = str2.concat((String)localIterator.next());
          if (localIterator.hasNext()) {
            str2 = str2.concat(" ");
          }
        }
      }
    }
    str2 = str2.concat(str1);
    str2 = str2.concat("Action List: ");
    if (actionList != null)
    {
      localIterator = actionList.iterator();
      if (localIterator != null)
      {
        Action localAction;
        for (str2 = str2.concat(str1); localIterator.hasNext(); str2 = str2.concat(localAction.toString())) {
          localAction = (Action)localIterator.next();
        }
      }
    }
    str2 = str2.concat(str1);
    return str2;
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.Association
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association;

public class AssociationAlreadyRegisteredException
  extends AssociationException
{
  public AssociationAlreadyRegisteredException() {}
  
  public AssociationAlreadyRegisteredException(String paramString)
  {
    super(paramString);
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.AssociationAlreadyRegisteredException
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association;

public class AssociationException
  extends Exception
{
  public AssociationException() {}
  
  public AssociationException(String paramString)
  {
    super(paramString);
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.AssociationException
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association;

public class AssociationNotRegisteredException
  extends AssociationException
{
  public AssociationNotRegisteredException() {}
  
  public AssociationNotRegisteredException(String paramString)
  {
    super(paramString);
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.AssociationNotRegisteredException
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association;

import com.sun.deploy.association.utility.AppAssociationReader;
import com.sun.deploy.association.utility.AppAssociationReaderFactory;
import com.sun.deploy.association.utility.AppAssociationWriter;
import com.sun.deploy.association.utility.AppAssociationWriterFactory;
import com.sun.deploy.association.utility.AppUtility;
import java.net.URL;
import java.util.Iterator;
import java.util.List;

public class AssociationService
{
  private AppAssociationReader appAssocReader = AppAssociationReaderFactory.newInstance();
  private AppAssociationWriter appAssocWriter = AppAssociationWriterFactory.newInstance();
  
  public Association getMimeTypeAssociation(String paramString)
  {
    if (paramString == null) {
      throw new IllegalArgumentException("The specified mime type is null");
    }
    if (!appAssocReader.isMimeTypeExist(paramString)) {
      return null;
    }
    Association localAssociation = new Association();
    List localList1 = appAssocReader.getFileExtListByMimeType(paramString);
    String str1 = appAssocReader.getIconFileNameByMimeType(paramString);
    String str2 = appAssocReader.getDescriptionByMimeType(paramString);
    List localList2 = appAssocReader.getActionListByMimeType(paramString);
    localAssociation.setMimeType(paramString);
    Iterator localIterator;
    if (localList1 != null)
    {
      localIterator = localList1.iterator();
      if (localIterator != null) {
        while (localIterator.hasNext()) {
          localAssociation.addFileExtension((String)localIterator.next());
        }
      }
    }
    if (str1 != null) {
      localAssociation.setIconFileName(str1);
    }
    if (str2 != null) {
      localAssociation.setDescription(str2);
    }
    if (localList2 != null)
    {
      localIterator = localList2.iterator();
      if (localIterator != null) {
        while (localIterator.hasNext()) {
          localAssociation.addAction((Action)localIterator.next());
        }
      }
    }
    return localAssociation;
  }
  
  public Association getFileExtensionAssociation(String paramString)
  {
    if (paramString == null) {
      throw new IllegalArgumentException("The specified file extension is null");
    }
    paramString = AppUtility.addDotToFileExtension(paramString);
    if (!appAssocReader.isFileExtExist(paramString)) {
      return null;
    }
    Association localAssociation = new Association();
    String str1 = appAssocReader.getMimeTypeByFileExt(paramString);
    String str2 = appAssocReader.getIconFileNameByFileExt(paramString);
    String str3 = appAssocReader.getDescriptionByFileExt(paramString);
    List localList = appAssocReader.getActionListByFileExt(paramString);
    localAssociation.addFileExtension(paramString);
    if (str2 != null) {
      localAssociation.setIconFileName(str2);
    }
    if (str1 != null) {
      localAssociation.setMimeType(str1);
    }
    if (str3 != null) {
      localAssociation.setDescription(str3);
    }
    if (localList != null)
    {
      Iterator localIterator = localList.iterator();
      if (localIterator != null) {
        while (localIterator.hasNext()) {
          localAssociation.addAction((Action)localIterator.next());
        }
      }
    }
    return localAssociation;
  }
  
  public Association getAssociationByContent(URL paramURL)
  {
    if (paramURL == null) {
      throw new IllegalArgumentException("The specified URL is null");
    }
    Association localAssociation = null;
    String str1 = appAssocReader.getMimeTypeByURL(paramURL);
    if (str1 != null) {
      localAssociation = getMimeTypeAssociation(str1);
    }
    if (localAssociation == null)
    {
      String str2 = AppUtility.getFileExtensionByURL(paramURL);
      if (str2 != null) {
        localAssociation = getFileExtensionAssociation(str2);
      }
    }
    return localAssociation;
  }
  
  public void registerUserAssociation(Association paramAssociation)
    throws AssociationAlreadyRegisteredException, RegisterFailedException
  {
    if (paramAssociation == null) {
      throw new IllegalArgumentException("The specified association is null");
    }
    try
    {
      appAssocWriter.checkAssociationValidForRegistration(paramAssociation);
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      throw localIllegalArgumentException;
    }
    if (appAssocWriter.isAssociationExist(paramAssociation, 1)) {
      throw new AssociationAlreadyRegisteredException("Assocation already exists!");
    }
    appAssocWriter.registerAssociation(paramAssociation, 1);
  }
  
  public void unregisterUserAssociation(Association paramAssociation)
    throws AssociationNotRegisteredException, RegisterFailedException
  {
    if (paramAssociation == null) {
      throw new IllegalArgumentException("The specified association is null");
    }
    try
    {
      appAssocWriter.checkAssociationValidForUnregistration(paramAssociation);
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      throw localIllegalArgumentException;
    }
    if (!appAssocWriter.isAssociationExist(paramAssociation, 1)) {
      throw new AssociationNotRegisteredException("Assocation not exists!");
    }
    appAssocWriter.unregisterAssociation(paramAssociation, 1);
  }
  
  public void registerSystemAssociation(Association paramAssociation)
    throws AssociationAlreadyRegisteredException, RegisterFailedException
  {
    if (paramAssociation == null) {
      throw new IllegalArgumentException("The specified association is null");
    }
    try
    {
      appAssocWriter.checkAssociationValidForRegistration(paramAssociation);
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      throw localIllegalArgumentException;
    }
    if (appAssocWriter.isAssociationExist(paramAssociation, 2)) {
      throw new AssociationAlreadyRegisteredException("Assocation already exists!");
    }
    appAssocWriter.registerAssociation(paramAssociation, 2);
  }
  
  public void unregisterSystemAssociation(Association paramAssociation)
    throws AssociationNotRegisteredException, RegisterFailedException
  {
    if (paramAssociation == null) {
      throw new IllegalArgumentException("The specified association is null");
    }
    try
    {
      appAssocWriter.checkAssociationValidForUnregistration(paramAssociation);
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      throw localIllegalArgumentException;
    }
    if (!appAssocWriter.isAssociationExist(paramAssociation, 2)) {
      throw new AssociationNotRegisteredException("Assocation not existed!");
    }
    appAssocWriter.unregisterAssociation(paramAssociation, 2);
  }
  
  public boolean hasAssociation(Association paramAssociation)
  {
    return (appAssocWriter.isAssociationExist(paramAssociation, 2)) || (appAssocWriter.isAssociationExist(paramAssociation, 1));
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.AssociationService
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association;

public class RegisterFailedException
  extends AssociationException
{
  public RegisterFailedException() {}
  
  public RegisterFailedException(String paramString)
  {
    super(paramString);
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.RegisterFailedException
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association.utility;

import java.net.URL;
import java.util.List;

public abstract interface AppAssociationReader
{
  public abstract String getDescriptionByMimeType(String paramString);
  
  public abstract String getDescriptionByFileExt(String paramString);
  
  public abstract String getMimeTypeByURL(URL paramURL);
  
  public abstract List getFileExtListByMimeType(String paramString);
  
  public abstract String getMimeTypeByFileExt(String paramString);
  
  public abstract String getIconFileNameByMimeType(String paramString);
  
  public abstract String getIconFileNameByFileExt(String paramString);
  
  public abstract List getActionListByFileExt(String paramString);
  
  public abstract List getActionListByMimeType(String paramString);
  
  public abstract boolean isMimeTypeExist(String paramString);
  
  public abstract boolean isFileExtExist(String paramString);
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.utility.AppAssociationReader
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association.utility;

public class AppAssociationReaderFactory
{
  public static AppAssociationReader newInstance()
  {
    return new WinAppAssociationReader();
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.utility.AppAssociationReaderFactory
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association.utility;

import com.sun.deploy.association.Association;
import com.sun.deploy.association.AssociationAlreadyRegisteredException;
import com.sun.deploy.association.AssociationNotRegisteredException;
import com.sun.deploy.association.RegisterFailedException;

public abstract interface AppAssociationWriter
{
  public static final int USER_LEVEL = 1;
  public static final int SYSTEM_LEVEL = 2;
  public static final int DEFAULT_LEVEL = 3;
  
  public abstract void checkAssociationValidForRegistration(Association paramAssociation)
    throws IllegalArgumentException;
  
  public abstract void checkAssociationValidForUnregistration(Association paramAssociation)
    throws IllegalArgumentException;
  
  public abstract boolean isAssociationExist(Association paramAssociation, int paramInt);
  
  public abstract void registerAssociation(Association paramAssociation, int paramInt)
    throws AssociationAlreadyRegisteredException, RegisterFailedException;
  
  public abstract void unregisterAssociation(Association paramAssociation, int paramInt)
    throws AssociationNotRegisteredException, RegisterFailedException;
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.utility.AppAssociationWriter
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association.utility;

public class AppAssociationWriterFactory
{
  public static AppAssociationWriter newInstance()
  {
    return new WinAppAssociationWriter();
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.utility.AppAssociationWriterFactory
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association.utility;

public abstract interface AppConstants
{
  public static final int USER_LEVEL = 1;
  public static final int SYSTEM_LEVEL = 2;
  public static final int DEFAULT_LEVEL = 3;
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.utility.AppConstants
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association.utility;

import java.net.URL;

public class AppUtility
{
  public static String getFileExtensionByURL(URL paramURL)
  {
    String str1 = paramURL.getFile().trim();
    if ((str1 == null) || (str1.equals("")) || (str1.equals("/"))) {
      return null;
    }
    int i = str1.lastIndexOf("/");
    String str2 = str1.substring(i + 1, str1.length());
    i = str2.lastIndexOf(".");
    if ((i == -1) || (i == str2.length() - 1)) {
      return null;
    }
    String str3 = str2.substring(i, str2.length());
    return str3;
  }
  
  public static String removeDotFromFileExtension(String paramString)
  {
    String str = paramString;
    if (paramString.charAt(0) == '.') {
      str = paramString.substring(1, paramString.length());
    }
    return str;
  }
  
  public static String addDotToFileExtension(String paramString)
  {
    String str1 = paramString;
    if (paramString.charAt(0) != '.')
    {
      String str2 = ".";
      str1 = str2.concat(paramString);
    }
    return str1;
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.utility.AppUtility
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association.utility;

import java.net.URL;
import java.util.ArrayList;
import java.util.List;

public class WinAppAssociationReader
  implements AppAssociationReader
{
  public String getDescriptionByMimeType(String paramString)
  {
    String str = WinRegistryUtil.getFileExtByMimeType(paramString);
    if (str != null) {
      return getDescriptionByFileExt(str);
    }
    return null;
  }
  
  public String getDescriptionByFileExt(String paramString)
  {
    return WinRegistryUtil.getDescriptionByFileExt(paramString);
  }
  
  public String getMimeTypeByURL(URL paramURL)
  {
    return WinRegistryUtil.getMimeTypeByURL(paramURL);
  }
  
  public List getFileExtListByMimeType(String paramString)
  {
    String str = WinRegistryUtil.getFileExtByMimeType(paramString);
    if (str != null)
    {
      ArrayList localArrayList = new ArrayList();
      localArrayList.add(str);
      return localArrayList;
    }
    return null;
  }
  
  public String getMimeTypeByFileExt(String paramString)
  {
    return WinRegistryUtil.getMimeTypeByFileExt(paramString);
  }
  
  public String getIconFileNameByMimeType(String paramString)
  {
    String str = WinRegistryUtil.getFileExtByMimeType(paramString);
    if (str != null) {
      return getIconFileNameByFileExt(str);
    }
    return null;
  }
  
  public String getIconFileNameByFileExt(String paramString)
  {
    return WinRegistryUtil.getIconFileNameByFileExt(paramString);
  }
  
  public List getActionListByMimeType(String paramString)
  {
    String str = WinRegistryUtil.getFileExtByMimeType(paramString);
    if (str != null) {
      return getActionListByFileExt(str);
    }
    return null;
  }
  
  public List getActionListByFileExt(String paramString)
  {
    return WinRegistryUtil.getActionListByFileExt(paramString);
  }
  
  public boolean isMimeTypeExist(String paramString)
  {
    return WinRegistryUtil.isMimeTypeExist(paramString);
  }
  
  public boolean isFileExtExist(String paramString)
  {
    return WinRegistryUtil.isFileExtExist(paramString);
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.utility.WinAppAssociationReader
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association.utility;

import com.sun.deploy.association.Association;
import java.util.Iterator;
import java.util.List;

public class WinAppAssociationWriter$BackupAssociation
{
  private String curMimeType;
  private String curFileExt;
  private boolean curMimeTypeExisted;
  private boolean curFileExtExisted;
  private String backupMimeType;
  private String backupClassID;
  private String backupFileExt;
  private final WinAppAssociationWriter this$0;
  
  private WinAppAssociationWriter$BackupAssociation(WinAppAssociationWriter paramWinAppAssociationWriter)
  {
    this$0 = paramWinAppAssociationWriter;
  }
  
  protected WinAppAssociationWriter$BackupAssociation(WinAppAssociationWriter paramWinAppAssociationWriter, Association paramAssociation, int paramInt)
  {
    this$0 = paramWinAppAssociationWriter;
    curMimeType = paramAssociation.getMimeType();
    Iterator localIterator = null;
    List localList = paramAssociation.getFileExtList();
    if (localList != null) {
      localIterator = localList.iterator();
    }
    if ((localIterator != null) && (localIterator.hasNext())) {
      curFileExt = ((String)localIterator.next());
    }
    if (curMimeType != null) {
      curMimeTypeExisted = WinRegistryUtil.isMimeTypeExist(curMimeType, paramInt);
    } else {
      curMimeTypeExisted = false;
    }
    if (curFileExt != null) {
      curFileExtExisted = WinRegistryUtil.isFileExtExist(curFileExt, paramInt);
    } else {
      curFileExtExisted = false;
    }
    if (curMimeTypeExisted) {
      backupFileExt = WinRegistryUtil.getFileExtByMimeType(curMimeType, paramInt);
    }
    if (curFileExtExisted)
    {
      backupClassID = WinRegistryUtil.getClassIDByFileExt(curFileExt, paramInt);
      backupMimeType = WinRegistryUtil.getMimeTypeByFileExt(curFileExt, paramInt);
    }
  }
  
  protected String getCurMimeType()
  {
    return curMimeType;
  }
  
  protected String getCurFileExt()
  {
    return curFileExt;
  }
  
  protected boolean getCurMimeTypeExisted()
  {
    return curMimeTypeExisted;
  }
  
  protected boolean getCurFileExtExisted()
  {
    return curFileExtExisted;
  }
  
  protected String getBackupMimeType()
  {
    return backupMimeType;
  }
  
  protected String getBackupClassID()
  {
    return backupClassID;
  }
  
  protected String getBackupFileExt()
  {
    return backupFileExt;
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.utility.WinAppAssociationWriter.BackupAssociation
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association.utility;

import com.sun.deploy.association.Association;
import com.sun.deploy.association.RegisterFailedException;
import java.util.Iterator;
import java.util.List;

public class WinAppAssociationWriter
  implements AppAssociationWriter
{
  private void restoreAssociationRegistration(BackupAssociation paramBackupAssociation, int paramInt)
  {
    try
    {
      String str1 = paramBackupAssociation.getCurMimeType();
      String str2 = paramBackupAssociation.getCurFileExt();
      String str3;
      if (!paramBackupAssociation.getCurMimeTypeExisted())
      {
        if (str1 != null) {
          WinRegistryUtil.removeMimeType(str1, paramInt);
        }
      }
      else
      {
        str3 = paramBackupAssociation.getBackupFileExt();
        if (str3 != null) {
          WinRegistryUtil.setFileExtByMimeType(str3, str1, paramInt);
        }
      }
      if (!paramBackupAssociation.getCurFileExtExisted())
      {
        if (str2 != null) {
          WinRegistryUtil.removeFileExt(str2, paramInt);
        }
      }
      else
      {
        str3 = paramBackupAssociation.getBackupMimeType();
        if (str3 != null) {
          WinRegistryUtil.setMimeTypeByFileExt(str3, str2, paramInt);
        }
        String str4 = paramBackupAssociation.getBackupClassID();
        if (str4 != null) {
          WinRegistryUtil.setClassIDByFileExt(str2, str4, paramInt);
        }
      }
    }
    catch (RegisterFailedException localRegisterFailedException) {}
  }
  
  private void restoreAssociationUnregistration(BackupAssociation paramBackupAssociation, int paramInt)
  {
    try
    {
      String str1 = paramBackupAssociation.getCurMimeType();
      String str2 = paramBackupAssociation.getCurFileExt();
      String str3;
      if (paramBackupAssociation.getCurMimeTypeExisted())
      {
        WinRegistryUtil.addMimeType(str1, paramInt);
        str3 = paramBackupAssociation.getBackupFileExt();
        if (str3 != null) {
          WinRegistryUtil.setFileExtByMimeType(str3, str1, paramInt);
        }
      }
      if (paramBackupAssociation.getCurFileExtExisted())
      {
        WinRegistryUtil.addFileExt(str2, paramInt);
        str3 = paramBackupAssociation.getBackupMimeType();
        String str4 = paramBackupAssociation.getBackupClassID();
        if (str3 != null) {
          WinRegistryUtil.setMimeTypeByFileExt(str3, str2, paramInt);
        }
        if (str4 != null) {
          WinRegistryUtil.setClassIDByFileExt(str2, str4, paramInt);
        }
      }
    }
    catch (RegisterFailedException localRegisterFailedException) {}
  }
  
  public void checkAssociationValidForRegistration(Association paramAssociation)
    throws IllegalArgumentException
  {
    boolean bool1 = true;
    boolean bool2 = true;
    int i = 0;
    if (paramAssociation.getActionList() != null) {
      bool1 = paramAssociation.getActionList().isEmpty();
    }
    if (paramAssociation.getFileExtList() != null) {
      bool2 = paramAssociation.getFileExtList().isEmpty();
    }
    if ((bool2) && (paramAssociation.getMimeType() == null)) {
      i = 0;
    } else if ((paramAssociation.getDescription() != null) || (paramAssociation.getIconFileName() != null) || (!bool1)) {
      i = !bool2 ? 1 : 0;
    } else {
      i = 1;
    }
    if (i == 0) {
      throw new IllegalArgumentException("The given association is invalid. It should specify both the mimeType and fileExtensionList fields to perform this operation.");
    }
  }
  
  public void checkAssociationValidForUnregistration(Association paramAssociation)
    throws IllegalArgumentException
  {
    boolean bool = true;
    if (paramAssociation.getFileExtList() != null) {
      bool = paramAssociation.getFileExtList().isEmpty();
    }
    if ((paramAssociation.getMimeType() == null) && (bool)) {
      throw new IllegalArgumentException("The given association is invalid. It should specify both the mimeType and fileExtensionList fields to perform this operation.");
    }
  }
  
  public boolean isAssociationExist(Association paramAssociation, int paramInt)
  {
    String str1 = null;
    String str2 = paramAssociation.getMimeType();
    Iterator localIterator;
    if (paramAssociation.getFileExtList() != null) {
      localIterator = paramAssociation.getFileExtList().iterator();
    } else {
      localIterator = null;
    }
    if ((localIterator != null) && (localIterator.hasNext())) {
      str1 = (String)localIterator.next();
    }
    if (WinRegistryUtil.isWin2kUserDefinedFileExtExist(str1)) {
      return true;
    }
    if ((str2 == null) && (str1 == null)) {
      return false;
    }
    if ((str2 == null) && (str1 != null)) {
      return WinRegistryUtil.isFileExtExist(str1, paramInt);
    }
    if ((str2 != null) && (str1 == null)) {
      return WinRegistryUtil.isMimeTypeExist(str2, paramInt);
    }
    String str3 = WinRegistryUtil.getMimeTypeByFileExt(str1, paramInt);
    String str4 = WinRegistryUtil.getFileExtByMimeType(str2, paramInt);
    return (WinRegistryUtil.isMimeTypeExist(str2, paramInt)) && (WinRegistryUtil.isFileExtExist(str1, paramInt)) && (str1 == null ? str4 == null : str1.equals(str4)) && (str2 == null ? str3 == null : str2.equals(str3));
  }
  
  public void registerAssociation(Association paramAssociation, int paramInt)
    throws RegisterFailedException
  {
    int i = 0;
    String str1 = System.getProperty("os.name").toLowerCase();
    if ((str1.indexOf("98") != -1) || (str1.indexOf("me") != -1) || (str1.indexOf("nt") != -1)) {
      i = 1;
    }
    if (i != 0) {
      paramInt = 2;
    }
    BackupAssociation localBackupAssociation = new BackupAssociation(paramAssociation, paramInt);
    String str2 = localBackupAssociation.getCurMimeType();
    String str3 = localBackupAssociation.getCurFileExt();
    String str4 = paramAssociation.getDescription();
    String str5 = paramAssociation.getIconFileName();
    List localList = paramAssociation.getActionList();
    boolean bool1 = localBackupAssociation.getCurMimeTypeExisted();
    boolean bool2 = localBackupAssociation.getCurFileExtExisted();
    try
    {
      if ((str2 == null) && (str3 != null))
      {
        WinRegistryUtil.addFileExt(str3, paramInt);
        if (str4 != null) {
          WinRegistryUtil.setDescriptionByFileExt(str4, str3, paramInt);
        }
        if (str5 != null) {
          WinRegistryUtil.setIconFileNameByFileExt(str5, str3, paramInt);
        }
        if (localList != null) {
          WinRegistryUtil.setActionListByFileExt(localList, str3, paramInt);
        }
        WinRegistryUtil.markGeneratorByFileExt(str3, paramInt);
      }
      else if ((str2 != null) && (str3 == null))
      {
        WinRegistryUtil.addMimeType(str2, paramInt);
      }
      else if ((str2 != null) && (str3 != null))
      {
        if (!bool1) {
          WinRegistryUtil.addMimeType(str2, paramInt);
        }
        if (!bool2) {
          WinRegistryUtil.addFileExt(str3, paramInt);
        }
        if (str4 != null) {
          WinRegistryUtil.setDescriptionByFileExt(str4, str3, paramInt);
        }
        if (str5 != null) {
          WinRegistryUtil.setIconFileNameByFileExt(str5, str3, paramInt);
        }
        if (localList != null) {
          WinRegistryUtil.setActionListByFileExt(localList, str3, paramInt);
        }
        WinRegistryUtil.markGeneratorByFileExt(str3, paramInt);
        WinRegistryUtil.setMutualRef(str3, str2, paramInt);
      }
    }
    catch (RegisterFailedException localRegisterFailedException)
    {
      restoreAssociationRegistration(localBackupAssociation, paramInt);
      throw localRegisterFailedException;
    }
  }
  
  public void unregisterAssociation(Association paramAssociation, int paramInt)
    throws RegisterFailedException
  {
    int i = 0;
    String str1 = System.getProperty("os.name").toLowerCase();
    if ((str1.indexOf("98") != -1) || (str1.indexOf("me") != -1) || (str1.indexOf("nt") != -1)) {
      i = 1;
    }
    if (i != 0) {
      paramInt = 2;
    }
    BackupAssociation localBackupAssociation = new BackupAssociation(paramAssociation, paramInt);
    String str2 = localBackupAssociation.getCurMimeType();
    String str3 = localBackupAssociation.getCurFileExt();
    boolean bool1 = localBackupAssociation.getCurMimeTypeExisted();
    boolean bool2 = localBackupAssociation.getCurFileExtExisted();
    try
    {
      if (bool1) {
        WinRegistryUtil.removeMimeType(str2, paramInt);
      }
      if (bool2) {
        WinRegistryUtil.removeFileExt(str3, paramInt);
      }
    }
    catch (RegisterFailedException localRegisterFailedException)
    {
      restoreAssociationUnregistration(localBackupAssociation, paramInt);
      throw localRegisterFailedException;
    }
  }
  
  protected class BackupAssociation
  {
    private String curMimeType;
    private String curFileExt;
    private boolean curMimeTypeExisted;
    private boolean curFileExtExisted;
    private String backupMimeType;
    private String backupClassID;
    private String backupFileExt;
    
    private BackupAssociation() {}
    
    protected BackupAssociation(Association paramAssociation, int paramInt)
    {
      curMimeType = paramAssociation.getMimeType();
      Iterator localIterator = null;
      List localList = paramAssociation.getFileExtList();
      if (localList != null) {
        localIterator = localList.iterator();
      }
      if ((localIterator != null) && (localIterator.hasNext())) {
        curFileExt = ((String)localIterator.next());
      }
      if (curMimeType != null) {
        curMimeTypeExisted = WinRegistryUtil.isMimeTypeExist(curMimeType, paramInt);
      } else {
        curMimeTypeExisted = false;
      }
      if (curFileExt != null) {
        curFileExtExisted = WinRegistryUtil.isFileExtExist(curFileExt, paramInt);
      } else {
        curFileExtExisted = false;
      }
      if (curMimeTypeExisted) {
        backupFileExt = WinRegistryUtil.getFileExtByMimeType(curMimeType, paramInt);
      }
      if (curFileExtExisted)
      {
        backupClassID = WinRegistryUtil.getClassIDByFileExt(curFileExt, paramInt);
        backupMimeType = WinRegistryUtil.getMimeTypeByFileExt(curFileExt, paramInt);
      }
    }
    
    protected String getCurMimeType()
    {
      return curMimeType;
    }
    
    protected String getCurFileExt()
    {
      return curFileExt;
    }
    
    protected boolean getCurMimeTypeExisted()
    {
      return curMimeTypeExisted;
    }
    
    protected boolean getCurFileExtExisted()
    {
      return curFileExtExisted;
    }
    
    protected String getBackupMimeType()
    {
      return backupMimeType;
    }
    
    protected String getBackupClassID()
    {
      return backupClassID;
    }
    
    protected String getBackupFileExt()
    {
      return backupFileExt;
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.deploy.association.utility.WinAppAssociationWriter
 * Java Class Version: 1.3 (47.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.deploy.association.utility;

import com.sun.deploy.association.Action;
import com.sun.deploy.association.RegisterFailedException;
import java.net.URL;
import java.util.ArrayList;
imp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd