[jbpm-commits] JBoss JBPM SVN: r5859 - in projects/bbq/projects/bbq-core/src: org and 3 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Oct 30 20:57:57 EDT 2009


Author: tom.baeyens at jboss.com
Date: 2009-10-30 20:57:56 -0400 (Fri, 30 Oct 2009)
New Revision: 5859

Added:
   projects/bbq/projects/bbq-core/src/org/
   projects/bbq/projects/bbq-core/src/org/bbq/
   projects/bbq/projects/bbq-core/src/org/bbq/Bbq.java
   projects/bbq/projects/bbq-core/src/org/bbq/BbqException.java
   projects/bbq/projects/bbq-core/src/org/bbq/commands/
   projects/bbq/projects/bbq-core/src/org/bbq/commands/Exec.java
   projects/bbq/projects/bbq-core/src/org/bbq/commands/Java.java
   projects/bbq/projects/bbq-core/src/org/bbq/commands/Javac.java
   projects/bbq/projects/bbq-core/src/org/bbq/commands/MkDir.java
   projects/bbq/projects/bbq-core/src/org/bbq/system/
   projects/bbq/projects/bbq-core/src/org/bbq/system/Console.java
   projects/bbq/projects/bbq-core/src/org/bbq/system/FileList.java
   projects/bbq/projects/bbq-core/src/org/bbq/system/FileScan.java
   projects/bbq/projects/bbq-core/src/org/bbq/system/Os.java
   projects/bbq/projects/bbq-core/src/org/bbq/system/Path.java
Log:
uploading bbq second attempt

Added: projects/bbq/projects/bbq-core/src/org/bbq/Bbq.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/Bbq.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/Bbq.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.bbq.commands.Javac;
+import org.bbq.commands.MkDir;
+import org.bbq.system.Console;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Bbq {
+
+  public static void main(String[] args) {
+    String buildClasspath = System.getProperty("java.class.path");
+    
+    new Javac()
+      .srcDir("build/src")
+      .destDir("build/gen/build-classes")
+      .classPath(buildClasspath)
+      .execute();
+
+    try {
+      URL[] urls = {new File("build/gen/build-classes").toURL()};
+      ClassLoader classLoader = new URLClassLoader(urls , Bbq.class.getClassLoader());
+      Class<?> buildClass = Class.forName("Build", true, classLoader);
+      for (String operation: args) {
+        Method method = buildClass.getDeclaredMethod(operation);
+        Object result = method.invoke(null, (Object[])null);
+        if (result!=null) {
+          Console.log("result of "+operation+": "+result);
+        }
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/Bbq.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: projects/bbq/projects/bbq-core/src/org/bbq/BbqException.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/BbqException.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/BbqException.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class BbqException extends RuntimeException {
+
+  private static final long serialVersionUID = 1L;
+
+  public BbqException(String message) {
+    super(message);
+  }
+  public BbqException(String message, Throwable cause) {
+    super(message, cause);
+  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/BbqException.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: projects/bbq/projects/bbq-core/src/org/bbq/commands/Exec.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/commands/Exec.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/commands/Exec.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq.commands;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.List;
+
+import org.bbq.BbqException;
+import org.bbq.system.Console;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Exec {
+
+  List<String> cmd;
+
+  public Exec(List<String> cmd) {
+    this.cmd = cmd;
+  }
+  
+  public void execute() {
+    try {
+      String msg = "exec";
+      for (String cmdPart: cmd) {
+        msg += " "+cmdPart;
+      }
+      Console.log(msg);
+      
+      ProcessBuilder processBuilder = new ProcessBuilder(cmd);
+      processBuilder.redirectErrorStream();
+      Process process = processBuilder.start();
+      
+      BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
+      for (String line = bufferedReader.readLine(); line!=null; line = bufferedReader.readLine()) {
+        Console.log(" |"+line);
+      }
+      
+    } catch (Exception e) {
+      throw new BbqException("couldn't exec "+cmd, e);
+    }
+  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/commands/Exec.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: projects/bbq/projects/bbq-core/src/org/bbq/commands/Java.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/commands/Java.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/commands/Java.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.bbq.system.Os;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Java {
+  
+  static String JAVA_HOME = System.getenv("JAVA_HOME");
+
+  String classPath;
+  String className;
+  String[] args;
+
+  public Java classPath(String classPath) {
+    this.classPath = classPath;
+    return this;
+  }
+
+  public Java className(String className) {
+    this.className = className;
+    return this;
+  }
+
+  public Java args(String[] args) {
+    this.args = args;
+    return this;
+  }
+
+  public void execute() {
+    // build up the command
+    List<String> cmd = new ArrayList<String>();
+    cmd.add(Java.JAVA_HOME+Os.FILE_SEPARATOR+"bin"+Os.FILE_SEPARATOR+"java");
+    cmd.add("-classpath");
+    cmd.add(classPath);
+    cmd.add(className);
+    
+    if (args!=null) {
+      for (String arg: args) {
+        cmd.add(arg);
+      }
+    }
+
+    // execute it
+    new Exec(cmd)
+      .execute();
+  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/commands/Java.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: projects/bbq/projects/bbq-core/src/org/bbq/commands/Javac.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/commands/Javac.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/commands/Javac.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.bbq.system.FileList;
+import org.bbq.system.FileScan;
+import org.bbq.system.Os;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Javac {
+  
+  FileList sourceFiles = new FileList();
+  boolean verbose;
+  String destDir;
+  String classPath;
+  
+  public Javac srcDir(String srcDir) {
+    FileList sourceFiles = new FileScan(srcDir)
+        .filterEnd(".java")
+        .execute();
+    
+    this.sourceFiles.add( sourceFiles );
+    
+    return this;
+  }
+
+  public Javac srcFile(String srcFile) {
+    this.sourceFiles.add( srcFile );
+    
+    return this;
+  }
+  
+  public Javac destDir(String dirPath) {
+    this.destDir = dirPath;
+    return this;
+  }
+  
+  public Javac classPath(String classPath) {
+    this.classPath = classPath;
+    return this;
+  }
+
+  public Javac verbose() {
+    this.verbose = true;
+    return this;
+  }
+
+  public void execute() {
+    // create the destination directory
+    new MkDir(destDir)
+      .execute();
+
+    // build up the compile command
+    List<String> cmd = new ArrayList<String>();
+    cmd.add(Java.JAVA_HOME+Os.FILE_SEPARATOR+"bin"+Os.FILE_SEPARATOR+"javac");
+    cmd.add("-d");
+    cmd.add(destDir);
+    if (classPath!=null) {
+      cmd.add("-classpath");
+      cmd.add(classPath);
+    }
+    if (verbose) {
+      cmd.add("-verbose");
+    }
+    for (String fileName: sourceFiles.list()) {
+      cmd.add(fileName);
+    }
+
+    // execute the compile command
+    new Exec(cmd)
+      .execute();
+  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/commands/Javac.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: projects/bbq/projects/bbq-core/src/org/bbq/commands/MkDir.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/commands/MkDir.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/commands/MkDir.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq.commands;
+
+import java.io.File;
+
+import org.bbq.system.Console;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class MkDir {
+  
+  String dirPath;
+
+  public MkDir(String dirPath) {
+    this.dirPath = dirPath;
+  }
+
+  public void execute() {
+    Console.log("mkdir "+dirPath);
+    new File(dirPath).mkdirs();
+  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/commands/MkDir.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: projects/bbq/projects/bbq-core/src/org/bbq/system/Console.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/system/Console.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/system/Console.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq.system;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Console {
+
+  public static void log(String msg) {
+    System.err.println(msg);
+  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/system/Console.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: projects/bbq/projects/bbq-core/src/org/bbq/system/FileList.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/system/FileList.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/system/FileList.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq.system;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FileList {
+  
+  List<String> filePaths = new ArrayList<String>(); 
+
+  public List<String> list() {
+    return filePaths;
+  }
+
+  public void add(String path) {
+    filePaths.add(path);
+  }
+
+  public void add(FileList other) {
+    filePaths.addAll(other.filePaths);
+  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/system/FileList.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: projects/bbq/projects/bbq-core/src/org/bbq/system/FileScan.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/system/FileScan.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/system/FileScan.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq.system;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class FileScan {
+
+  String rootDir;
+  List<ScanFilter> scanFilters = new ArrayList<ScanFilter>();
+  
+  public FileScan(String dirPath) {
+    rootDir = dirPath;
+  }
+  
+  public FileList execute() {
+    FileList fileList = new FileList();
+    scan(rootDir, fileList);
+    return fileList;
+  }
+
+  private void scan(String dir, FileList fileList) {
+    File dirFile = new File(dir);
+    for (File child: dirFile.listFiles()) {
+      String childPath = ("".equals(dir) ? child.getName() : dir+"/"+child.getName());
+      if (child.isDirectory()) {
+        scan(childPath, fileList);
+      } else if (passesFilters(childPath, child)) {
+        fileList.add(childPath);
+      }
+    }
+  }
+  
+  private boolean passesFilters(String relativePath, File file) {
+    for (ScanFilter scanFilter: scanFilters) {
+      if (!scanFilter.passes(relativePath, file)) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  private interface ScanFilter {
+    boolean passes(String relativePath, File file);
+  }
+  
+  private class EndScanFilter implements ScanFilter {
+    String text;
+    public EndScanFilter(String text) {
+      this.text = text;
+    }
+    public boolean passes(String relativePath, File file) {
+      return relativePath.endsWith(text);
+    }
+  }
+
+  public FileScan filterEnd(String text) {
+    scanFilters.add(new EndScanFilter(text));
+    return this;
+  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/system/FileScan.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: projects/bbq/projects/bbq-core/src/org/bbq/system/Os.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/system/Os.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/system/Os.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq.system;
+
+import org.bbq.BbqException;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Os {
+
+  public static final String WINDOWS = "windows";
+
+  public static final String TYPE = getType();
+  public static final String FILE_SEPARATOR = System.getProperty("file.separator");
+
+  private static String getType() {
+    String name = System.getProperty("os.name");
+    if (name.indexOf("Windows")!=-1) {
+      return WINDOWS;
+    }
+    throw new BbqException("unknown os: "+name);
+  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/system/Os.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: projects/bbq/projects/bbq-core/src/org/bbq/system/Path.java
===================================================================
--- projects/bbq/projects/bbq-core/src/org/bbq/system/Path.java	                        (rev 0)
+++ projects/bbq/projects/bbq-core/src/org/bbq/system/Path.java	2009-10-31 00:57:56 UTC (rev 5859)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.bbq.system;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Path {
+
+//  public static String toOsSpecific(String path) {
+//  }
+//
+//  public static String toGeneric(String path) {
+//  }
+//
+//  public static String toAbsolute(String path) {
+//  }
+}


Property changes on: projects/bbq/projects/bbq-core/src/org/bbq/system/Path.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain



More information about the jbpm-commits mailing list