From 3abf3909dfa306d20358a3538da212b7cb64f52a Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 16 Aug 2008 17:42:25 +0000 Subject: Update: Renamed Subversion plugin folder The folder name "svn" was annoying Subversion because svn is a special name to it. Fixes #36 --- .../com/fourisland/instadisc/update/svn/MD5.java | 68 ------------------ .../com/fourisland/instadisc/update/svn/Main.java | 83 ---------------------- 2 files changed, 151 deletions(-) delete mode 100644 update/plugin/svn/trunk/src/com/fourisland/instadisc/update/svn/MD5.java delete mode 100644 update/plugin/svn/trunk/src/com/fourisland/instadisc/update/svn/Main.java (limited to 'update/plugin/svn/trunk/src/com') diff --git a/update/plugin/svn/trunk/src/com/fourisland/instadisc/update/svn/MD5.java b/update/plugin/svn/trunk/src/com/fourisland/instadisc/update/svn/MD5.java deleted file mode 100644 index 0929022..0000000 --- a/update/plugin/svn/trunk/src/com/fourisland/instadisc/update/svn/MD5.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package com.fourisland.instadisc.update.svn; - -import java.security.MessageDigest; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author hatkirby - */ -public class MD5 { - - String ver; - - public MD5(String ver) { - this.ver = ver; - } - - public MD5(char[] password) { - int i=0; - ver=""; - for (i=0;i y ? x : y); - } - - private String pad(String in, String pad, int len) - { - while (in.length() < len) - { - in = pad + in; - } - return in; - } -} diff --git a/update/plugin/svn/trunk/src/com/fourisland/instadisc/update/svn/Main.java b/update/plugin/svn/trunk/src/com/fourisland/instadisc/update/svn/Main.java deleted file mode 100644 index 1bc9a07..0000000 --- a/update/plugin/svn/trunk/src/com/fourisland/instadisc/update/svn/Main.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.fourisland.instadisc.update.svn; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Random; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.apache.xmlrpc.XmlRpcException; -import org.apache.xmlrpc.client.XmlRpcClient; -import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; - -public class Main { - - public static void main(String[] args) { - try - { - String username = getArg(0, args); - String password = getArg(1, args); - String centralServer = getArg(2, args); - String pathScheme = getArg(3, args); - String author = getArg(4, args); - String subscription = getArg(5, args); - String revision = getArg(6, args); - - StringBuilder messBuilder = new StringBuilder(); - byte rs = 0; - - while (rs != -1) - { - try - { - rs = (byte) System.in.read(); - if (rs != -1) - { - messBuilder.append(new String(new byte[]{rs})); - } - } catch (IOException ex) - { - Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); - } - } - - String message = messBuilder.toString(); - message = message.substring(0, message.indexOf("\n")); - - Random r = new Random(); - int verID = r.nextInt(Integer.MAX_VALUE); - - String path = pathScheme.replace("__REV__", revision); - - XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); - config.setServerURL(new URL(centralServer)); - XmlRpcClient client = new XmlRpcClient(); - client.setConfig(config); - client.execute("InstaDisc.sendFromUpdate", new Object[]{username, - (new MD5(username + ":" + (new MD5(password)).hash() + ":" + verID)).hash(), - verID, - subscription, - message, - author, - path, - "a:0:{}" - }); - } catch (XmlRpcException ex) - { - Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); - } catch (MalformedURLException ex) - { - Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); - } - } - - public static String getArg(int arg, String[] args) { - if (args.length < (arg+1)) - { - System.out.println("Program requires 7 arguments and you only provided " + arg); - System.exit(1); - } - - return args[arg]; - } -} -- cgit 1.4.1