Browse Source

updates to a few classes; removed gradle; removed .idea/

Gary Paduana 5 năm trước cách đây
mục cha
commit
0e89fdddd7

+ 2 - 0
.gitignore

@@ -7,3 +7,5 @@ build/
 **/.idea/tasks.xml
 
 .DS_Store
+.idea/
+target/

+ 0 - 9
.idea/codeStyleSettings.xml

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ProjectCodeStyleSettingsManager">
-    <option name="PER_PROJECT_SETTINGS">
-      <value />
-    </option>
-    <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default (1)" />
-  </component>
-</project>

+ 0 - 9
.idea/compiler.xml

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="CompilerConfiguration">
-    <bytecodeTargetLevel>
-      <module name="groovy-tools_main" target="1.8" />
-      <module name="groovy-tools_test" target="1.8" />
-    </bytecodeTargetLevel>
-  </component>
-</project>

+ 0 - 18
.idea/gradle.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="GradleSettings">
-    <option name="linkedExternalProjectsSettings">
-      <GradleProjectSettings>
-        <option name="distributionType" value="LOCAL" />
-        <option name="externalProjectPath" value="$PROJECT_DIR$" />
-        <option name="gradleHome" value="$USER_HOME$/Downloads/gradle-3.4.1" />
-        <option name="modules">
-          <set>
-            <option value="$PROJECT_DIR$" />
-          </set>
-        </option>
-        <option name="useAutoImport" value="true" />
-      </GradleProjectSettings>
-    </option>
-  </component>
-</project>

+ 0 - 11
.idea/libraries/Gradle__com_sun_mail_javax_mail_1_5_3.xml

@@ -1,11 +0,0 @@
-<component name="libraryTable">
-  <library name="Gradle: com.sun.mail:javax.mail:1.5.3">
-    <CLASSES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.sun.mail/javax.mail/1.5.3/a6ab2437933757407082cb86aaeb655549296067/javax.mail-1.5.3.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.sun.mail/javax.mail/1.5.3/cce488a0fd790ac67ce658d66199ec9f5e194398/javax.mail-1.5.3-sources.jar!/" />
-    </SOURCES>
-  </library>
-</component>

+ 0 - 11
.idea/libraries/Gradle__javax_activation_activation_1_1.xml

@@ -1,11 +0,0 @@
-<component name="libraryTable">
-  <library name="Gradle: javax.activation:activation:1.1">
-    <CLASSES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.activation/activation/1.1/e6cb541461c2834bdea3eb920f1884d1eb508b50/activation-1.1.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.activation/activation/1.1/3697e9f67a2ed7ac5f589cff30f21173299440/activation-1.1-sources.jar!/" />
-    </SOURCES>
-  </library>
-</component>

+ 0 - 11
.idea/libraries/Gradle__junit_junit_4_12.xml

@@ -1,11 +0,0 @@
-<component name="libraryTable">
-  <library name="Gradle: junit:junit:4.12">
-    <CLASSES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/a6c32b40bf3d76eca54e3c601e5d1470c86fcdfa/junit-4.12-sources.jar!/" />
-    </SOURCES>
-  </library>
-</component>

+ 0 - 11
.idea/libraries/Gradle__org_codehaus_groovy_groovy_all_2_4_9.xml

@@ -1,11 +0,0 @@
-<component name="libraryTable">
-  <library name="Gradle: org.codehaus.groovy:groovy-all:2.4.9">
-    <CLASSES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.9/3334e99a8baae12d6e014d444149e337ceb99a00/groovy-all-2.4.9.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.9/35c41a130264a801b171d8ad74b27f62b34bb6fa/groovy-all-2.4.9-sources.jar!/" />
-    </SOURCES>
-  </library>
-</component>

+ 0 - 11
.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml

@@ -1,11 +0,0 @@
-<component name="libraryTable">
-  <library name="Gradle: org.hamcrest:hamcrest-core:1.3">
-    <CLASSES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b/hamcrest-core-1.3-sources.jar!/" />
-    </SOURCES>
-  </library>
-</component>

+ 0 - 11
.idea/libraries/Gradle__org_spockframework_spock_core_1_0_groovy_2_4.xml

@@ -1,11 +0,0 @@
-<component name="libraryTable">
-  <library name="Gradle: org.spockframework:spock-core:1.0-groovy-2.4">
-    <CLASSES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.spockframework/spock-core/1.0-groovy-2.4/ceaa8b69f274ed3de24da3e6a6c86f673b426d1a/spock-core-1.0-groovy-2.4.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES>
-      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.spockframework/spock-core/1.0-groovy-2.4/db9597087c5e4afc2ef795c8ae89e32eddd019a6/spock-core-1.0-groovy-2.4-sources.jar!/" />
-    </SOURCES>
-  </library>
-</component>

+ 0 - 44
.idea/misc.xml

@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ClientPropertiesManager">
-    <properties class="javax.swing.AbstractButton">
-      <property name="hideActionText" class="java.lang.Boolean" />
-    </properties>
-    <properties class="javax.swing.JComponent">
-      <property name="html.disable" class="java.lang.Boolean" />
-    </properties>
-    <properties class="javax.swing.JEditorPane">
-      <property name="JEditorPane.w3cLengthUnits" class="java.lang.Boolean" />
-      <property name="JEditorPane.honorDisplayProperties" class="java.lang.Boolean" />
-      <property name="charset" class="java.lang.String" />
-    </properties>
-    <properties class="javax.swing.JList">
-      <property name="List.isFileList" class="java.lang.Boolean" />
-    </properties>
-    <properties class="javax.swing.JPasswordField">
-      <property name="JPasswordField.cutCopyAllowed" class="java.lang.Boolean" />
-    </properties>
-    <properties class="javax.swing.JSlider">
-      <property name="Slider.paintThumbArrowShape" class="java.lang.Boolean" />
-      <property name="JSlider.isFilled" class="java.lang.Boolean" />
-    </properties>
-    <properties class="javax.swing.JTable">
-      <property name="Table.isFileList" class="java.lang.Boolean" />
-      <property name="JTable.autoStartsEdit" class="java.lang.Boolean" />
-      <property name="terminateEditOnFocusLost" class="java.lang.Boolean" />
-    </properties>
-    <properties class="javax.swing.JToolBar">
-      <property name="JToolBar.isRollover" class="java.lang.Boolean" />
-    </properties>
-    <properties class="javax.swing.JTree">
-      <property name="JTree.lineStyle" class="java.lang.String" />
-    </properties>
-    <properties class="javax.swing.text.JTextComponent">
-      <property name="caretAspectRatio" class="java.lang.Double" />
-      <property name="caretWidth" class="java.lang.Integer" />
-    </properties>
-  </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
-    <output url="file://$PROJECT_DIR$/out" />
-  </component>
-</project>

+ 0 - 10
.idea/modules.xml

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ProjectModuleManager">
-    <modules>
-      <module fileurl="file://$PROJECT_DIR$/.idea/modules/groovy-tools.iml" filepath="$PROJECT_DIR$/.idea/modules/groovy-tools.iml" />
-      <module fileurl="file://$PROJECT_DIR$/.idea/modules/groovy-tools_main.iml" filepath="$PROJECT_DIR$/.idea/modules/groovy-tools_main.iml" group="groovy-tools" />
-      <module fileurl="file://$PROJECT_DIR$/.idea/modules/groovy-tools_test.iml" filepath="$PROJECT_DIR$/.idea/modules/groovy-tools_test.iml" group="groovy-tools" />
-    </modules>
-  </component>
-</project>

+ 0 - 12
.idea/modules/groovy-tools.iml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module external.linked.project.id="groovy-tools" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
-    <exclude-output />
-    <content url="file://$MODULE_DIR$/../..">
-      <excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
-      <excludeFolder url="file://$MODULE_DIR$/../../build" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>

+ 0 - 20
.idea/modules/groovy-tools_main.iml

@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module external.linked.project.id="groovy-tools:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
-    <output url="file://$MODULE_DIR$/../../out/production/classes" />
-    <exclude-output />
-    <content url="file://$MODULE_DIR$/../../src/main">
-      <sourceFolder url="file://$MODULE_DIR$/../../src/main/groovy" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/../../src/main/resources" type="java-resource" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="library" name="Gradle: org.codehaus.groovy:groovy-all:2.4.9" level="project" />
-    <orderEntry type="library" name="Gradle: com.sun.mail:javax.mail:1.5.3" level="project" />
-    <orderEntry type="library" name="Gradle: org.spockframework:spock-core:1.0-groovy-2.4" level="project" />
-    <orderEntry type="library" name="Gradle: junit:junit:4.12" level="project" />
-    <orderEntry type="library" name="Gradle: javax.activation:activation:1.1" level="project" />
-    <orderEntry type="library" name="Gradle: org.hamcrest:hamcrest-core:1.3" level="project" />
-  </component>
-</module>

+ 0 - 22
.idea/modules/groovy-tools_test.iml

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module external.linked.project.id="groovy-tools:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
-    <output-test url="file://$MODULE_DIR$/../../out/test/classes" />
-    <exclude-output />
-    <content url="file://$MODULE_DIR$/../../src/test">
-      <sourceFolder url="file://$MODULE_DIR$/../../src/test/groovy" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/../../src/test/resources" type="java-test-resource" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module" module-name="groovy-tools_main" />
-    <orderEntry type="library" name="Gradle: org.codehaus.groovy:groovy-all:2.4.9" level="project" />
-    <orderEntry type="library" name="Gradle: com.sun.mail:javax.mail:1.5.3" level="project" />
-    <orderEntry type="library" name="Gradle: org.spockframework:spock-core:1.0-groovy-2.4" level="project" />
-    <orderEntry type="library" name="Gradle: junit:junit:4.12" level="project" />
-    <orderEntry type="library" name="Gradle: javax.activation:activation:1.1" level="project" />
-    <orderEntry type="library" name="Gradle: org.hamcrest:hamcrest-core:1.3" level="project" />
-  </component>
-  <component name="TestModuleProperties" production-module="groovy-tools_main" />
-</module>

+ 0 - 124
.idea/uiDesigner.xml

@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="Palette2">
-    <group name="Swing">
-      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
-      </item>
-      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
-      </item>
-      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
-      </item>
-      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
-        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
-      </item>
-      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
-        <initial-values>
-          <property name="text" value="Button" />
-        </initial-values>
-      </item>
-      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
-        <initial-values>
-          <property name="text" value="RadioButton" />
-        </initial-values>
-      </item>
-      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
-        <initial-values>
-          <property name="text" value="CheckBox" />
-        </initial-values>
-      </item>
-      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
-        <initial-values>
-          <property name="text" value="Label" />
-        </initial-values>
-      </item>
-      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
-          <preferred-size width="150" height="-1" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
-          <preferred-size width="150" height="-1" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
-          <preferred-size width="150" height="-1" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
-      </item>
-      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
-          <preferred-size width="150" height="50" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
-          <preferred-size width="200" height="200" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
-          <preferred-size width="200" height="200" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
-      </item>
-      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
-      </item>
-      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
-      </item>
-      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
-      </item>
-      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
-          <preferred-size width="-1" height="20" />
-        </default-constraints>
-      </item>
-      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
-        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
-      </item>
-      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
-        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
-      </item>
-    </group>
-  </component>
-</project>

+ 0 - 12
build.gradle

@@ -1,12 +0,0 @@
-apply plugin: 'groovy'
-
-repositories {
-    mavenCentral()
-}
-
-dependencies {
-    compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.9'
-    compile group: 'com.sun.mail', name: 'javax.mail', version: '1.5.3'
-    compile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.4'
-    compile group: 'junit', name: 'junit', version: '4.12'
-}

+ 83 - 0
dependency-reduced-pom.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>com.garypaduana</groupId>
+  <artifactId>groovy-tools</artifactId>
+  <version>0.9.0</version>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>compile</id>
+            <phase>compile</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <tasks>
+                <mkdir />
+                <taskdef>
+                  <classpath />
+                </taskdef>
+                <mkdir />
+                <groovyc>
+                  <classpath />
+                </groovyc>
+              </tasks>
+            </configuration>
+          </execution>
+          <execution>
+            <id>test-compile</id>
+            <phase>test-compile</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <tasks>
+                <mkdir />
+                <taskdef>
+                  <classpath />
+                </taskdef>
+                <mkdir />
+                <groovyc>
+                  <classpath />
+                </groovyc>
+              </tasks>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <transformers>
+                <transformer>
+                  <mainClass>${start-class}</mainClass>
+                </transformer>
+              </transformers>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.groovy</groupId>
+      <artifactId>groovy-all</artifactId>
+      <version>2.5.7</version>
+      <type>pom</type>
+      <scope>compile</scope>
+    </dependency>
+  </dependencies>
+  <properties />
+</project>

+ 131 - 0
pom.xml

@@ -0,0 +1,131 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.garypaduana</groupId>
+    <artifactId>groovy-tools</artifactId>
+    <version>0.9.0</version>
+    <packaging>jar</packaging>
+
+    <properties>
+        <start-class></start-class>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.codehaus.groovy</groupId>
+            <artifactId>groovy-all</artifactId>
+            <version>2.5.7</version>
+            <type>pom</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.yaml</groupId>
+            <artifactId>snakeyaml</artifactId>
+            <version>1.18</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sun.mail</groupId>
+            <artifactId>javax.mail</artifactId>
+            <version>1.6.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.spockframework</groupId>
+            <artifactId>spock-core</artifactId>
+            <version>1.3-groovy-2.5</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <!--
+              The current maven implementation:
+              http://docs.groovy-lang.org/latest/html/documentation/tools-groovyc.html#_maven_integration
+
+              Alternative solution: https://github.com/groovy/groovy-eclipse/wiki/Groovy-Eclipse-Maven-plugin
+            -->
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>compile</id>
+                        <phase>compile</phase>
+                        <configuration>
+                            <tasks>
+                                <mkdir dir="${basedir}/src/main/groovy"/>
+                                <taskdef name="groovyc"
+                                         classname="org.codehaus.groovy.ant.Groovyc">
+                                    <classpath refid="maven.compile.classpath"/>
+                                </taskdef>
+                                <mkdir dir="${project.build.outputDirectory}"/>
+                                <groovyc destdir="${project.build.outputDirectory}"
+                                         srcdir="${basedir}/src/main/groovy/" listfiles="true">
+                                    <classpath refid="maven.compile.classpath"/>
+                                </groovyc>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>test-compile</id>
+                        <phase>test-compile</phase>
+                        <configuration>
+                            <tasks>
+                                <mkdir dir="${basedir}/src/test/groovy"/>
+                                <taskdef name="groovyc"
+                                         classname="org.codehaus.groovy.ant.Groovyc">
+                                    <classpath refid="maven.test.classpath"/>
+                                </taskdef>
+                                <mkdir dir="${project.build.testOutputDirectory}"/>
+                                <groovyc destdir="${project.build.testOutputDirectory}"
+                                         srcdir="${basedir}/src/test/groovy/" listfiles="true">
+                                    <classpath refid="maven.test.classpath"/>
+                                </groovyc>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+<!--            <plugin>-->
+<!--                <groupId>org.apache.maven.plugins</groupId>-->
+<!--                <artifactId>maven-shade-plugin</artifactId>-->
+<!--                <version>3.2.1</version>-->
+<!--                <executions>-->
+<!--                    <execution>-->
+<!--                        <phase>package</phase>-->
+<!--                        <goals>-->
+<!--                            <goal>shade</goal>-->
+<!--                        </goals>-->
+<!--                        <configuration>-->
+<!--                            <transformers>-->
+<!--                                <transformer-->
+<!--                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">-->
+<!--                                    <mainClass>${start-class}</mainClass>-->
+<!--                                </transformer>-->
+<!--                            </transformers>-->
+<!--                        </configuration>-->
+<!--                    </execution>-->
+<!--                </executions>-->
+<!--            </plugin>-->
+        </plugins>
+    </build>
+
+</project>

+ 56 - 1
src/main/groovy/com/garypaduana/groovytools/data/Calculations.groovy

@@ -2,6 +2,8 @@ package com.garypaduana.groovytools.data
 
 import com.garypaduana.groovytools.formatting.StringCleaner
 
+import java.security.MessageDigest
+
 class Calculations {
 
     static def calculateParity(String hex, int parityBitLength){
@@ -13,7 +15,7 @@ class Calculations {
         }
 
         if((hex.length() * 4) % parityBitLength != 0) {
-            throw new IllegalArgumentException("Invalid word length found!")
+            throw new IllegalArgumentException("invalid word length found")
         }
 
         def pieces = []
@@ -32,4 +34,57 @@ class Calculations {
 
         return Long.toHexString(parity).toLowerCase()
     }
+
+    /**
+     * A generic method to generate a hex string representation of a message digest.
+     *
+     * @param file - the file to be analyzed.
+     * @param digest - the digest to generate, e.g. "MD5", "SHA-1"
+     * @param maxLength - the number of bytes to read from the file. if no bytes are desired,
+     *                       you must supply -1 or the first buffered chunk will be read.
+     * @param paddedLength - the total length of the string representation of the message digest.
+     *                          e.g. MD5 = 32, SHA-1 = 40
+     * @return
+     */
+    static String generateDigest(File file, String digest, long maxLength, int paddedLength) {
+        MessageDigest md = MessageDigest.getInstance(digest)
+        md.reset()
+        if (file.canRead()) {
+            file.withInputStream() { is ->
+                byte[] buffer = new byte[8192]
+                int read = 0
+                int totalRead = 0
+                while ((read = is.read(buffer)) > 0 && totalRead <= maxLength) {
+                    totalRead += read
+                    md.update(buffer, 0, read)
+                }
+            }
+        }
+
+        byte[] digestBytes = md.digest()
+        BigInteger bigInt = new BigInteger(1, digestBytes)
+        return bigInt.toString(16).padLeft(paddedLength, '0')
+    }
+
+    /**
+     * Generates an MD5 signature using all bytes in the file.
+     * @param file
+     * @return
+     */
+    static String generateMD5(File file) {
+        return generateDigest(file, "MD5", Long.MAX_VALUE, 32)
+    }
+
+    /**
+     * Generates an MD5 signature using up to 1MB (2^20) bytes from the
+     * beginning of the file.  Useful to quickly determine if two large files
+     * are different without having to read every byte in each.  If there is
+     * equality after this method is evaluated for each file then a full
+     * processing should occur for each.
+     * @param file
+     * @return
+     */
+    static String generateShortMD5(File file) {
+        return generateDigest(file, "MD5", 1048576, 32)
+    }
 }

+ 52 - 61
src/main/groovy/com/garypaduana/groovytools/data/structure/BinaryTree.groovy

@@ -1,135 +1,128 @@
 package com.garypaduana.groovytools.data.structure
 
-class BinaryTree{
+class BinaryTree {
 
-    static class Node{
+    static class Node {
         def leftChild
         def rightChild
         def element
         def parent
 
-        Node(def element){
+        Node(def element) {
             this.element = element
         }
 
         @Override
-        public String toString(){
+        public String toString() {
             return element
         }
     }
 
     def root
 
-    def insert(def element){
+    def insert(def element) {
 
-        if(root == null){
+        if (root == null) {
             root = new Node(element)
-        }
-        else{
+        } else {
             def focusNode = root
-            while(true){
-                if(element < focusNode.element){
-                    if(focusNode.leftChild == null){
+            while (true) {
+                if (element < focusNode.element) {
+                    if (focusNode.leftChild == null) {
                         focusNode.leftChild = new Node(element)
                         focusNode.leftChild.parent = focusNode
                         return
-                    }
-                    else{
+                    } else {
                         focusNode = focusNode.leftChild
                     }
-                }
-                else if(element > focusNode.element){
-                    if(focusNode.rightChild == null){
+                } else if (element > focusNode.element) {
+                    if (focusNode.rightChild == null) {
                         focusNode.rightChild = new Node(element)
                         focusNode.rightChild.parent = focusNode
                         return
-                    }
-                    else{
+                    } else {
                         focusNode = focusNode.rightChild
                     }
-                }
-                else{
+                } else {
                     return
                 }
             }
         }
     }
 
-    def contains(def element){
+    def contains(def element) {
         def node = root
-        while(true){
-            if(node == null){
+        while (true) {
+            if (node == null) {
                 return false
             }
-            if(element < node.element){
+            if (element < node.element) {
                 node = node.leftChild
-            }
-            else if(element > node.element){
+            } else if (element > node.element) {
                 node = node.rightChild
-            }
-            else if(element == node.element){
+            } else if (element == node.element) {
                 return true
             }
         }
     }
 
-    def preOrderTraverse(){
+    def preOrderTraverse() {
         return preOrderTraverse(root)
     }
 
-    def preOrderTraverse(def node){
-        if(node == null){
+    def preOrderTraverse(def node) {
+        if (node == null) {
             return []
         }
 
         def elements = []
         elements.add(node.element)
 
-        if(node.leftChild != null){
+        if (node.leftChild != null) {
             elements.addAll(preOrderTraverse(node.leftChild))
         }
-        if(node.rightChild != null){
+        if (node.rightChild != null) {
             elements.addAll(preOrderTraverse(node.rightChild))
         }
 
         return elements
     }
 
-    def inOrderTraverse(){
+    def inOrderTraverse() {
         return inOrderTraverse(root)
     }
 
-    def inOrderTraverse(def node){
-        if(node == null){
+    def inOrderTraverse(def node) {
+        if (node == null) {
             return []
         }
 
         def elements = []
-        if(node.leftChild != null){
+        if (node.leftChild != null) {
             elements.addAll(inOrderTraverse(node.leftChild))
         }
         elements.add(node.element)
-        if(node.rightChild != null){
+        if (node.rightChild != null) {
             elements.addAll(inOrderTraverse(node.rightChild))
         }
 
         return elements
     }
 
-    def postOrderTraverse(){
+    def postOrderTraverse() {
         return postOrderTraverse(root)
     }
 
-    def postOrderTraverse(def node){
-        if(node == null){
+    def postOrderTraverse(def node) {
+        if (node == null) {
             return []
         }
 
         def elements = []
-        if(node.leftChild != null){
+        if (node.leftChild != null) {
             elements.addAll(postOrderTraverse(node.leftChild))
         }
-        if(node.rightChild != null){
+        if (node.rightChild != null) {
             elements.addAll(postOrderTraverse(node.rightChild))
         }
         elements.add(node.element)
@@ -137,23 +130,22 @@ class BinaryTree{
         return elements
     }
 
-    def iterativePreorderTraverse(){
+    def iterativePreorderTraverse() {
         return iterativePreorderTraverse(root)
     }
 
-    def iterativePreorderTraverse(def node){
+    def iterativePreorderTraverse(def node) {
         def elements = []
         def parentStack = new Stack()
 
-        while(parentStack.size() != 0 || node != null){
-            if(node != null){
+        while (parentStack.size() != 0 || node != null) {
+            if (node != null) {
                 elements.add(node.element)
-                if(node.rightChild != null){
+                if (node.rightChild != null) {
                     parentStack.push(node.rightChild)
                 }
                 node = node.leftChild
-            }
-            else{
+            } else {
                 node = parentStack.pop()
             }
         }
@@ -161,20 +153,19 @@ class BinaryTree{
         return elements
     }
 
-    def iterativeInOrderTraverse(){
+    def iterativeInOrderTraverse() {
         return iterativeInOrderTraverse(root)
     }
 
-    def iterativeInOrderTraverse(def node){
+    def iterativeInOrderTraverse(def node) {
         def elements = []
         def parentStack = new Stack()
 
-        while(parentStack.size() != 0 || node != null){
-            if(node != null){
+        while (parentStack.size() != 0 || node != null) {
+            if (node != null) {
                 parentStack.push(node)
                 node = node.leftChild
-            }
-            else{
+            } else {
                 node = parentStack.pop()
                 elements.add(node.element)
                 node = node.rightChild
@@ -183,23 +174,23 @@ class BinaryTree{
         return elements
     }
 
-    def levelOrderTraverse(){
+    def levelOrderTraverse() {
         return levelOrderTraverse(root)
     }
 
-    def levelOrderTraverse(def node){
+    def levelOrderTraverse(def node) {
         def q = new Queue()
         q.enqueue(node)
         def elements = []
 
-        while(q.size() > 0){
+        while (q.size() > 0) {
             node = q.dequeue()
             elements.add(node.element)
 
-            if(node.leftChild != null){
+            if (node.leftChild != null) {
                 q.enqueue(node.leftChild)
             }
-            if(node.rightChild != null){
+            if (node.rightChild != null) {
                 q.enqueue(node.rightChild)
             }
         }

+ 22 - 0
src/main/groovy/com/garypaduana/groovytools/system/OSValidator.groovy

@@ -0,0 +1,22 @@
+package com.garypaduana.groovytools.system
+
+class OSValidator {
+
+    private static String OS = System.getProperty("os.name").toLowerCase();
+
+    static boolean isWindows() {
+        return (OS.indexOf("win") >= 0);
+    }
+
+    static boolean isMac() {
+        return (OS.indexOf("mac") >= 0);
+    }
+
+    static boolean isUnix() {
+        return (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0);
+    }
+
+    static boolean isSolaris() {
+        return (OS.indexOf("sunos") >= 0);
+    }
+}

+ 28 - 3
src/main/groovy/com/garypaduana/groovytools/system/Process.groovy

@@ -27,24 +27,49 @@ class Process {
     }
 
     /**
-     * A way to make system calls while capturing the error stream.
+     * A way to make system calls while capturing the error stream with an optional customer Writer for output.
+     * @param command - the command to execute
+     * @param print - should the output be printed line by line?
+     * @param writer
+     * @return String - the complete output
+     */
+    static def execute(String command, boolean print, Writer writer) {
+        return execute(new ArrayList<String>(Arrays.asList(command.split(" "))), print, writer)
+    }
+
+    /**
+     * A way to make system calls while capturing the error stream and optionally printing to System.out.
+     *
      * @param command - the command to execute
      * @param print - should the output be printed to console line by line?
      * @return String - the complete output
      */
     static def execute(List<String> command, boolean print) {
+        return execute(command, print, new PrintWriter(System.out))
+    }
+
+    /**
+     * A way to make system calls while capturing the error stream with an optional customer Writer for output.
+     * @param command
+     * @param print
+     * @param writer
+     * @return
+     */
+    static def execute(List<String> command, boolean print, Writer writer) {
         StringBuilder sb = new StringBuilder()
         if (print) {
-            println "Executing: ${command.join(' ')}"
+            writer.println("Executing: ${command.join(' ')}")
         }
         def process = new ProcessBuilder(command).redirectErrorStream(true).start()
         process.inputStream.eachLine {
             if (print) {
-                println it
+                writer.println(it)
+                writer.flush()
             }
             sb.append(it).append("\n")
         }
         process.waitFor()
+        writer.close()
         return [exitValue: process.exitValue(), body: sb.toString()]
     }
 }