package org.crosswire.listserv; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringWriter; import java.io.Writer; public class MailmanAdaptor implements MailingListAdaptor { final String mailmanBin = "/usr/lib64/mailman/bin/"; int runCommand(String[] command, Writer result) { int retVal = -1; try { Process p = Runtime.getRuntime().exec(command); InputStream is = p.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader input = new BufferedReader(isr); String line; while ((line = input.readLine()) != null) { result.write(line); } retVal = p.waitFor(); } catch (Exception e) { e.printStackTrace(); }return retVal; } @Override public String[] getListsNames() { String util = mailmanBin+"list_lists"; StringWriter resp = new StringWriter(); int result = runCommand(new String[] { util, "-sbn", "yo", }, resp); return null; } @Override public void removeList(String listName) { // TODO Auto-generated method stub } @Override public void addList(String listName) { // TODO Auto-generated method stub } @Override public String[] getListMembers(String listName) { // TODO Auto-generated method stub return null; } @Override public void removeListMember(String listName, String memberName) { // TODO Auto-generated method stub } @Override public void addListMember(String listName, String memberName) { // TODO Auto-generated method stub } }