本来ならば、DOM か SAX などの JAXP API を使えばいいのですが、通勤中の Caltrain の中でさっと開発したため、API ドキュメントにアクセスできず、強引に plain text として処理し、必要な項目だけを抜き出すことにしました。また、value も string のものだけをサポートしています。
$ cat PList.java import java.io.Serializable; import java.util.HashMap; import java.util.Map; public class PList implements Serializable { private Map<String,String> dict; public PList() { dict = new HashMap<String,String>(); } public void put(String key, String value) { dict.put(key, value); } public String get(String key) { return dict.get(key); } public Map<String,String> getDict() { return dict; } } $ cat PListReader.java import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.PrintWriter; public class PListReader extends BufferedReader { public PListReader(Reader in) throws IOException { super(in); } public PListReader(InputStream is) throws IOException { this(new InputStreamReader(is, "UTF-8")); } public PListReader(String filename) throws IOException { this(new FileInputStream(filename)); } public String readKey() throws IOException { while (true) { String line = readLine(); if (line == null) { return null; } int n = line.indexOf("<key>"); if (n < 0) { continue; } int m = line.indexOf("</key>", n+5); if (m < 0) { continue; } return line.substring(n+5, m); } } public String readStringValue() throws IOException { String line = readLine(); if (line == null) { return null; } int n = line.indexOf("<string>"); if (n < 0) { return null; } int m = line.indexOf("</string>", n+8); if (m < 0) { return null; } return line.substring(n+8, m); } public String[] readKeyAndStringValue() throws IOException { while (true) { String key = readKey(); if (key == null) { break; } String value = readStringValue(); if (value == null) { continue; } return new String[] { key, value }; } return null; } public PList readPList() throws IOException { PList plist = new PList(); while (true) { String[] pair = readKeyAndStringValue(); if (pair == null) { break; } String key = pair[0]; String value = pair[1]; plist.put(key, value); } return plist; } public void printPList(PrintWriter out, String separator) throws IOException { while (true) { String[] pair = readKeyAndStringValue(); if (pair == null) { break; } String key = pair[0]; String value = pair[1]; out.printf("%s%s%s%n", key, separator, value); } } public static void main(String[] args) throws IOException { PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out, "UTF-8")); if (args.length > 0) { for (String filename : args) { plist(out, filename); } } else { BufferedReader in = new BufferedReader(new InputStreamReader(System.in, "UTF-8")); while (true) { String filename = in.readLine(); if (filename == null) { break; } plist(out, filename); } } out.flush(); out.close(); } public static void plist(PrintWriter out, String filename) throws IOException { out.printf("[ %s ]%n", filename); PListReader in = new PListReader(filename); in.printPList(out, " = "); in.close(); out.println(); // out.flush(); } } $ cat DpmInfo.java import java.io.File; import java.io.IOException; public class DpmInfo { private static final String pluginFolderName = "/Library/Application Support/Digidesign/Plug-ins"; private String folderName; private String fileName; private PList plist; public DpmInfo(String dpmName) throws IOException { folderName = dpmName; if (! folderName.startsWith("/")) { folderName = pluginFolderName + "/" + folderName; } if (! folderName.endsWith(".dpm")) { folderName = folderName + ".dpm"; } int n = folderName.lastIndexOf('/'); fileName = folderName.substring(n+1); String plistFilename = folderName + "/Contents/Info.plist"; PListReader in = new PListReader(plistFilename); plist = in.readPList(); in.close(); } public String getFolderName() { return folderName; } public String getFileName() { return fileName; } public String getBundleName() { return plist.get("CFBundleName"); } public String getBundleVersion() { return plist.get("CFBundleVersion"); } public String getBundleInfo() { String bundleInfo = plist.get("CFBundleGetInfoString"); if (bundleInfo == null) { bundleInfo = ""; } return bundleInfo; } } $ cat DpmLister.java import java.io.File; import java.io.IOException; public class DpmLister { private static final int fontSize = 1; private static final String pluginFolderName = "/Library/Application Support/Digidesign/Plug-ins"; public static void main(String[] args) throws IOException { File folder = new File(pluginFolderName); System.out.println("<table border=1>"); System.out.print("<tr>"); System.out.print("<td align=center><i>File</i></td>"); System.out.print("<td align=center><i>Name</i></td>"); System.out.print("<td align=center><i>Version</i></td>"); System.out.print("<td align=center><i>Bundle Info</i></td>"); System.out.println("</tr>"); for (String dpmName : folder.list()) { if (! dpmName.endsWith(".dpm")) { continue; } DpmInfo dpmInfo = new DpmInfo(dpmName); printDpmInfo(dpmInfo); } System.out.println("</table>"); System.out.flush(); } public static void printDpmInfo(DpmInfo dpmInfo) throws IOException { String fileName = dpmInfo.getFileName(); String bundleName = dpmInfo.getBundleName(); String bundleVersion = dpmInfo.getBundleVersion(); String bundleInfo = dpmInfo.getBundleInfo(); if (bundleInfo == null) { bundleInfo = ""; } print(new String[] { fileName, bundleName, bundleVersion, bundleInfo }); } private static void print(String[] ss) { System.out.print("<tr>"); for (String s : ss) { if (s == null || s.length() == 0) { s = "∓nbsp;"; } System.out.printf("<td align=left valign=top><font size=%d>%s</font></td>", fontSize, s); } System.out.println("</tr>"); } } $ javac *.java $ java DpmLister > dpmlist.html $ |
File | Name | Version | Bundle Info |
AIRChorus.dpm | AIRChorus | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRDistortion.dpm | AIRDistortion | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRDynamicDelay.dpm | AIRDynamicDelay | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIREnhancer.dpm | AIREnhancer | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIREnsemble.dpm | AIREnsemble | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRFilterGate.dpm | AIRFilterGate | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRFlanger.dpm | AIRFlanger | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRFrequencyShifter.dpm | AIRFrequencyShifter | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRFuzz-Wah.dpm | AIRFuzz-Wah | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRKillEQ.dpm | AIRKillEQ | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRLo-Fi.dpm | AIRLo-Fi | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRMulti-Chorus.dpm | AIRMulti-Chorus | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRMulti-Delay.dpm | AIRMulti-Delay | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRNon-linearReverb.dpm | AIRNon-LinearReverb | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRPhaser.dpm | AIRPhaser | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRReverb.dpm | AIRReverb | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRSpringReverb.dpm | AIRSpringReverb | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRStereoWidth.dpm | AIRStereoWidth | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRTalkbox.dpm | AIRTalkbox | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
AIRVintageFilter.dpm | AIRVintageFilter | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
Analog_Channel_LE.dpm | Analog_Channel_LE | 3.2x18 | 3.2x18, Copyright 1998-2007 McDowell Signal Processing, LLC |
BF Essential Clip Remover.dpm | BF Essential Clip Remover | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
BF Essential Corr.dpm | BF Essential Corr | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
BF Essential Meter.dpm | BF Essential Meter | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
BF Essential Noise.dpm | BF Essential Noise | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
bombfactory BF-2A.dpm | bombfactory BF-2A | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
bombfactory BF-3A.dpm | bombfactory BF-3A | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
bombfactory BF76.dpm | bombfactory BF76 | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Boom.dpm | Boom | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
Chorus.dpm | Chorus | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Chrome_Tone_LE.dpm | Chrome_Tone_LE | 2.2x18 | 2.2x18, Copyright 1998-2007 McDowell Signal Processing, LLC |
Click.dpm | Click | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
CompressorBank_LE.dpm | CompressorBank_LE | 4.2x18 | 4.2x18, Copyright 1998-2007 McDowell Signal Processing, LLC |
Cosmonaut Voice.dpm | Cosmonaut Voice | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
D-Verb.dpm | D-Verb | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
DB-33.dpm | DB-33 | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
DigiReWire.dpm | DigiReWire | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Dither.dpm | Dither | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Dynamics III.dpm | Dynamics III | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Elastic Audio.dpm | Elastic Audio | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Eleven Free.dpm | Eleven Free | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Eleven LE.dpm | Eleven LE | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
EQ III.dpm | EQ III | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
EZplayer.dpm | EZplayer | 7.3d0 | ? Toontrack AB 2006, Version 1.0.2 |
Fairchild 660.dpm | Fairchild 660 | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Fairchild 670.dpm | Fairchild 670 | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
FilterBank_LE.dpm | FilterBank_LE | 4.2x18 | 4.2x18, Copyright 1998-2007 McDowell Signal Processing, LLC |
Flanger.dpm | Flanger | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Hybrid.dpm | Hybrid | 1.5.2.7597 | 1.5.2.7597 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
Invert-Duplicate.dpm | Invert-Duplicate | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
JOEMEEK Compressor.dpm | JOEMEEK Compressor | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
JOEMEEK Meequalizer.dpm | JOEMEEK Meequalizer | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
LoFi.dpm | LoFi | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Maxim.dpm | Maxim | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
MelodyneBridge.dpm | 3.2.2.2 | ||
MiniGrand.dpm | MiniGrand | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
ML4000_LE.dpm | ML4000_LE | 1.1x18 | 1.1x18, Copyright 1998-2007 McDowell Signal Processing, LLC |
Mod Delay II.dpm | Mod Delay II | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
moogerfooger AD.dpm | moogerfooger AD | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
moogerfooger LP.dpm | moogerfooger LP | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
moogerfooger Ph.dpm | moogerfooger Ph | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
moogerfooger RM.dpm | moogerfooger RM | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Multi-Tap Delay.dpm | Multi-Tap Delay | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Normalize-Gain.dpm | Normalize-Gain | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Ping-Pong Delay.dpm | Ping-Pong Delay | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Purple Audio MC77.dpm | Purple Audio MC77 | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
RectiFi.dpm | RectiFi | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Reverse-DC Removal.dpm | Reverse-DC Removal | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Revolver_LE.dpm | Revolver_LE | 1.2x18 | 1.2x18, Copyright 1998-2007 McDowell Signal Processing, LLC |
SansAmp PSA-1.dpm | SansAmp PSA-1 | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
SciFi.dpm | SciFi | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Signal Generator.dpm | Signal Generator | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
SignalTools.dpm | SignalTools | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Smack! LE.dpm | Smack! LE | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
SoundReplacer.dpm | SoundReplacer | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Structure.dpm | Structure LE | 1.0.2.7584 | 1.0.2.7584 Copyright 2008 Digidesign, A Division of Avid Technology, Inc. |
Superior Drummer.dpm | Superior Drummer | 7.3d0 | ? Toontrack AB 2007, Version 2.0.1 |
Synth_One_LE.dpm | Synth_One_LE | 4.2x18 | 4.2x18, Copyright 1998-2007 McDowell Signal Processing, LLC |
Tel-Ray Delay.dpm | Tel-Ray Delay | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Time Comp-Exp-Pitch Shift.dpm | Time Comp-Exp-Pitch Shift | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Time Shift.dpm | Time Shift | 8.0.0f314 | 8.0.0, Copyright ? 2005 by Digidesign, a division of Avid. All rights reserved. |
TimeAdjuster.dpm | TimeAdjuster | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
TL AutoPan.dpm | TL AutoPan | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
TL EveryPhase.dpm | TL EveryPhase | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
TL InTune.dpm | TL InTune | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
TL MasterMeter.dpm | TL MasterMeter | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
TL Metro.dpm | TL Metro | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
TL Space Native.dpm | TL Space Native | 8.0.0f314 | 8.0.0, Copyright 1991-2006 Digidesign, A Division of Avid Technology, Inc. |
Trim.dpm | Trim | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Vacuum.dpm | Vacuum | 1.0.0.8542 | 1.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
VariFi.dpm | VariFi | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Voce Chorus-Vibrato.dpm | Voce Chorus-Vibrato | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
Voce Spin.dpm | Voce Spin | 8.0.0f314 | 8.0.0, Copyright 1991-2008 Digidesign, A Division of Avid Technology, Inc. |
WaveShell-DAE 6.0.6.dpm | WaveShell-DAE 6.0.6 | 6.0.6 | |
XPand!.dpm | Xpand! | 2.0.0.8542 | 2.0.0.8542 Copyright 2005-2007 Digidesign, A Division of Avid Technology, Inc. |
Tags: music_technology, programming