wms-release-tools

16:54:14.134 INFO  jd.cli.Main - Decompiling wms-release-tools.jar
package com.wowza.util;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintStream;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;

public class PatchReleaseNoteTask
  extends Task
{
  private String sourceFile = "";
  private String destFile = "";
  
  public PatchReleaseNoteTask()
  {
    setDescription("Wowza Media Systems Patch Release Notes Generator");
  }
  
  public void setSourcefile(String paramString)
  {
    sourceFile = paramString;
  }
  
  public void setDestfile(String paramString)
  {
    destFile = paramString;
  }
  
  public void execute()
    throws BuildException
  {
    File localFile1 = new File(sourceFile);
    File localFile2 = new File(destFile);
    if (!localFile1.exists()) {
      throw new BuildException("File not found: " + sourceFile);
    }
    try
    {
      BufferedReader localBufferedReader = new BufferedReader(new FileReader(localFile1));
      BufferedWriter localBufferedWriter = new BufferedWriter(new FileWriter(localFile2));
      Object localObject = null;
      int i = 0;
      while (localBufferedReader.ready())
      {
        String str = localBufferedReader.readLine();
        if (localObject != null)
        {
          if ((((String)localObject).matches("={1,}")) && (str.matches("Changes in.*")))
          {
            if (i > 0) {
              break;
            }
            i++;
          }
          localBufferedWriter.write((String)localObject);
          localBufferedWriter.write("\r\n");
        }
        localObject = str;
      }
      localBufferedReader.close();
      localBufferedWriter.close();
    }
    catch (Exception localException)
    {
      throw new BuildException("Error generating release notes", localException);
    }
  }
  
  public static void main(String[] paramArrayOfString)
  {
    if (paramArrayOfString.length < 2)
    {
      System.out.println("Usage: java -jar <jar> inFile outFile");
      System.exit(1);
    }
    PatchReleaseNoteTask localPatchReleaseNoteTask = new PatchReleaseNoteTask();
    localPatchReleaseNoteTask.setSourcefile(paramArrayOfString[0]);
    localPatchReleaseNoteTask.setDestfile(paramArrayOfString[1]);
    localPatchReleaseNoteTask.execute();
  }
}

/* Location:
 * Qualified Name:     com.wowza.util.PatchReleaseNoteTask
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.wowza.util;

import org.apache.tools.ant.types.DataType;

public class VariableSubstitutionTask$Substitution
  extends DataType
{
  private String var;
  private String val;
  
  public String getVar()
  {
    return var;
  }
  
  public void setVar(String paramString)
  {
    var = paramString;
  }
  
  public String getValue()
  {
    return val;
  }
  
  public void setValue(String paramString)
  {
    val = paramString;
  }
}

/* Location:
 * Qualified Name:     com.wowza.util.VariableSubstitutionTask.Substitution
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.wowza.util;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.DataType;

public class VariableSubstitutionTask
  extends Task
{
  private String sourceFile = "";
  private String destFile = "";
  private List<Substitution> substitutions = new ArrayList();
  
  public VariableSubstitutionTask()
  {
    setDescription("Wowza Media Systems Variable Substitution");
  }
  
  public void setSourcefile(String paramString)
  {
    sourceFile = paramString.replaceAll("\\\\", "/");
  }
  
  public void setDestfile(String paramString)
  {
    destFile = paramString.replaceAll("\\\\", "/");
  }
  
  public Substitution createSubstitution()
  {
    Substitution localSubstitution = new Substitution();
    substitutions.add(localSubstitution);
    return localSubstitution;
  }
  
  public void addSubstitution(Substitution paramSubstitution)
  {
    substitutions.add(paramSubstitution);
    System.out.println("addSubstitution: " + paramSubstitution);
  }
  
  public void execute()
    throws BuildException
  {
    File localFile1 = new File(sourceFile);
    File localFile2 = new File(destFile);
    if (!localFile1.exists()) {
      throw new BuildException("File not found: " + sourceFile);
    }
    try
    {
      BufferedReader localBufferedReader = new BufferedReader(new FileReader(localFile1));
      LinkedList localLinkedList = new LinkedList();
      HashMap localHashMap = new HashMap();
      Object localObject1 = substitutions.iterator();
      while (((Iterator)localObject1).hasNext())
      {
        localObject2 = (Substitution)((Iterator)localObject1).next();
        localHashMap.put(var, ((Substitution)localObject2).getValue());
      }
      String str;
      while (localBufferedReader.ready())
      {
        localObject1 = localBufferedReader.readLine();
        localObject2 = localHashMap.keySet().iterator();
        while (((Iterator)localObject2).hasNext())
        {
          str = (String)((Iterator)localObject2).next();
          if (((String)localObject1).contains(str)) {
            localObject1 = ((String)localObject1).replaceAll("\\$\\{" + str + "\\}", (String)localHashMap.get(str));
          }
        }
        localLinkedList.add(localObject1);
      }
      localBufferedReader.close();
      localBufferedReader = null;
      System.gc();
      localObject1 = new BufferedWriter(new FileWriter(localFile2));
      Object localObject2 = localLinkedList.iterator();
      while (((Iterator)localObject2).hasNext())
      {
        str = (String)((Iterator)localObject2).next();
        ((BufferedWriter)localObject1).write(str);
        ((BufferedWriter)localObject1).write("\r\n");
      }
      ((BufferedWriter)localObject1).close();
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      throw new BuildException("Error performing variable substitution", localException);
    }
  }
  
  public static void main(String[] paramArrayOfString)
  {
    if (paramArrayOfString.length < 4)
    {
      System.out.println("Usage: java -jar <jar> inFile outFile var replace");
      System.exit(1);
    }
    VariableSubstitutionTask localVariableSubstitutionTask = new VariableSubstitutionTask();
    localVariableSubstitutionTask.setSourcefile(paramArrayOfString[0]);
    localVariableSubstitutionTask.setDestfile(paramArrayOfString[1]);
    Substitution localSubstitution = localVariableSubstitutionTask.createSubstitution();
    localSubstitution.setVar(paramArrayOfString[2]);
    localSubstitution.setValue(paramArrayOfString[3]);
    localVariableSubstitutionTask.addSubstitution(localSubstitution);
    localVariableSubstitutionTask.execute();
  }
  
  public static class Substitution
    extends DataType
  {
    private String var;
    private String val;
    
    public String getVar()
    {
      return var;
    }
    
    public void setVar(String paramString)
    {
      var = paramString;
    }
    
    public String getValue()
    {
      return val;
    }
    
    public void setValue(String paramString)
    {
      val = paramString;
    }
  }
}

/* Location:
 * Qualified Name:     com.wowza.util.VariableSubstitutionTask
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

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-2019. Infinite Loop Ltd