Merge remote-tracking (subtree) branch 'PracticingJava/master'
This commit is contained in:
commit
8506e9286e
2
PracticingJava/.gitignore
vendored
Normal file
2
PracticingJava/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.class
|
||||
dist
|
27
PracticingJava/build.xml
Normal file
27
PracticingJava/build.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="LearningJava" default="build">
|
||||
|
||||
<target name="clean" description="remove intermediate files">
|
||||
<delete>
|
||||
<fileset dir="obj" includes="**/*.class"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="build" description="compile Java sources">
|
||||
<javac srcdir="src" destdir="obj" includeantruntime="yes"/>
|
||||
</target>
|
||||
|
||||
<target name="jar" depends="build"
|
||||
description="create Jar from compiled sources">
|
||||
<mkdir dir="dist" />
|
||||
<jar destfile="dist/learning-java.jar">
|
||||
<fileset dir="obj" includes="**/*.class"/>
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="hello" depends="build" description="runs HelloSir">
|
||||
<java classname="com.meatballhat.learningjava.HelloSir"
|
||||
classpath="obj"/>
|
||||
</target>
|
||||
|
||||
</project>
|
2
PracticingJava/foobar.properties
Normal file
2
PracticingJava/foobar.properties
Normal file
@ -0,0 +1,2 @@
|
||||
foo.bar = hambones
|
||||
ham.bones = foobar
|
0
PracticingJava/obj/.keep
Normal file
0
PracticingJava/obj/.keep
Normal file
@ -0,0 +1,14 @@
|
||||
package com.meatballhat.learningjava;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public final class CleanPipe {
|
||||
|
||||
public static void main(String[] argv) throws IOException {
|
||||
int c;
|
||||
while((c = System.in.read()) != -1) {
|
||||
System.out.write(c);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.meatballhat.learningjava;
|
||||
|
||||
|
||||
public class HelloSir {
|
||||
|
||||
public static void main(String[] argv) {
|
||||
System.out.println("OMG Hi Der");
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.meatballhat.learningjava;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
|
||||
public class ShowProps {
|
||||
public static String USAGE = "Usage: ShowProps <properties-file>";
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
try {
|
||||
|
||||
if (args.length >= 1) {
|
||||
FileInputStream instream = new FileInputStream(args[0]);
|
||||
Properties props = new Properties();
|
||||
props.load(instream);
|
||||
instream.close();
|
||||
props.list(System.out);
|
||||
|
||||
} else {
|
||||
System.out.println(USAGE);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("OMG FAIL");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user