This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JsonParser extends Parser { | |
public JsonParser(Parser successor){ | |
this.setSuccessor(successor); | |
} | |
@Override | |
public void parse(String fileName) { | |
if ( canHandleFile(fileName, ".json")){ | |
System.out.println("A JSON parser is handling the file: "+fileName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
import java.util.ArrayList; | |
public class ChainOfResponsibilityDemo { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TextParser extends Parser{ | |
public TextParser(Parser successor){ | |
this.setSuccessor(successor); | |
} | |
@Override | |
public void parse(String fileName) { | |
if ( canHandleFile(fileName, ".txt")){ | |
System.out.println("A text parser is handling the file: "+fileName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set DIR=%~dp0 | |
set LIB=%DIR%..\lib\* | |
set BIN=%DIR%..\bin | |
REM ??? | |
"%JAVA8_HOME%\bin\java" -cp "%LIB%" -Dlog4j.configurationFile="%BIN%\log4j2.xml" "org.xbib.tools.Runner" "org.xbib.tools.JDBCImporter" world-importer-config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
bin=${DIR}/../bin | |
lib=${DIR}/../lib | |
java \ | |
-cp "${lib}/*" \ | |
-Dlog4j.configurationFile=${bin}/log4j2.xml \ | |
org.xbib.tools.Runner \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type" : "jdbc", | |
"jdbc" : { | |
"password" : "******", | |
"user" : "root", | |
"url" : "jdbc:mysql://localhost:3306/world", | |
"sql" : [ { | |
"statement" : "world.sql" | |
} ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.Closeable; | |
import java.io.IOException; | |
/** | |
* Created by IntelliJ IDEA. | |
* User: mohamed | |
* Date: 2/5/12 | |
* Time: 9:24 PM | |
* To change this template use File | Settings | File Templates. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
co.Code 'code', | |
co.name 'name', | |
co.Continent 'continent', | |
co.region 'region', | |
co.SurfaceArea 'surface_area', | |
co.IndepYear 'year_of_independence', | |
co.Population 'population', | |
co.LifeExpectancy 'life_expectancy', | |
co.GovernmentForm 'government_form', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"aliases":{}, | |
"warmers":{}, | |
"mappings": { | |
"world": { | |
"properties": { | |
"capital": { | |
"properties": { | |
"district": { | |
"type": "string" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
import java.io.FileReader; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.net.URL; |