diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f5c5c56..0000000 --- a/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -*.class - -# Package Files # -*.jar -*.war -*.ear -*.patch -.classpath -.project -target -.settings -.DS_Store diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 82cf303..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: java -sudo: false -cache: - directories: - - $HOME/.m2 -script: -# - mvn clean install -Pqulice --errors --batch-mode - - mvn clean install --errors --batch-mode -env: - global: - - MAVEN_OPTS="-Xmx256m -Dfile.encoding=UTF-8" - - JAVA_OPTS="-Xmx256m -Dfile.encoding=UTF-8" -jdk: - - oraclejdk8 - - oraclejdk7 -# - openjdk6 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 0b5b5c1..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,45 +0,0 @@ -pipeline { - agent { - docker { - image 'maven' - } - - } - stages { - stage('whoami') { - steps { - sh '''whoami -''' - } - } - stage('pwd') { - steps { - sh '''pwd -''' - } - } - stage('Java Version') { - steps { - sh '''javac -version -''' - } - } - stage('mvn --version') { - steps { - sh '''mvn --version -''' - } - } - stage('cat releases') { - steps { - sh '''cat /etc/*-rele* -''' - } - } - stage('mvn clean install') { - steps { - sh 'mvn clean install' - } - } - } -} \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 712c536..0000000 --- a/README.md +++ /dev/null @@ -1,71 +0,0 @@ -java-utils -========== - -[![Build Status](https://travis-ci.org/eidoscode/java-utils.svg?branch=master)](https://travis-ci.org/eidoscode/java-utils) -[![Build status](https://ci.appveyor.com/api/projects/status/v4fyhfqu23bcokfn/branch/master?svg=true)](https://ci.appveyor.com/project/antonini/java-utils/branch/master) - -The purpose of this project is to group utilities that are used on most of other Java projects. - - -## Available Utilities - -### 1. Collection - -//... TODO - -### 2. Multithread - -//... TODO - -### 3. IO - -//... TODO - -#### 3.1. Stream - -//... TODO - -#### 3.2. Zip - -//... TODO - -### 4. JAXRS - -//... TODO - -### 5. Resources - -//... TODO - - - -## Requirements - -* At least Java 7; -* Apache Maven 3.3+ (developer); - - - -## How to contribute - -Fork repository, make changes, send a pull request. We are going to review your changes and apply them to the `master`. - -This project is created usign Apache Maven so check the requirements listed above to developers. - -Before sending a pull request don't forget to run all unit tests: - -``` -$ mvn clean install -``` - -If your default encoding is not UTF-8, some of unit tests will break. This -is an intentional behavior. To fix that, set this environment variable -in console (in Windows, for example): - -``` -SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 -``` - -## Bugs, Improvement or Questions? - -So, found a bug, want some improvement or just have a questions about how to do someting? Then [open an issue](https://github.com/eidoscode/java-utils/issues/new) an we will try to help you. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 88c1340..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '{build}' -skip_tags: true -clone_depth: 10 -environment: - matrix: - - JAVA_HOME: C:\Program Files\Java\jdk1.7.0 -branches: - only: - - master - except: - - gh-pages -os: Windows Server 2012 -install: - - ps: | - Add-Type -AssemblyName System.IO.Compression.FileSystem - if (!(Test-Path -Path "C:\maven" )) { - (new-object System.Net.WebClient).DownloadFile('http://www.us.apache.org/dist/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.zip', 'C:\maven-bin.zip') - [System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven") - } - - cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;%JAVA_HOME%\bin;%PATH:C:\Ruby193\bin;=% - - cmd: SET MAVEN_OPTS=-XX:MaxPermSize=2g -Xmx4g -Dfile.encoding=UTF-8 - - cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g -Dfile.encoding=UTF-8 - - cmd: SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 - - cmd: mvn --version - - cmd: java -version -build_script: - - mvn clean package -B -Dmaven.test.skip=true -test_script: - - mvn clean install --batch-mode -cache: - - C:\maven\ - - C:\Users\appveyor\.m2 diff --git a/images/body-bg.jpg b/images/body-bg.jpg new file mode 100644 index 0000000..0e0f861 Binary files /dev/null and b/images/body-bg.jpg differ diff --git a/images/download-button.png b/images/download-button.png new file mode 100644 index 0000000..df3f09a Binary files /dev/null and b/images/download-button.png differ diff --git a/images/github-button.png b/images/github-button.png new file mode 100644 index 0000000..efe07f9 Binary files /dev/null and b/images/github-button.png differ diff --git a/images/header-bg.jpg b/images/header-bg.jpg new file mode 100644 index 0000000..960bff7 Binary files /dev/null and b/images/header-bg.jpg differ diff --git a/images/highlight-bg.jpg b/images/highlight-bg.jpg new file mode 100644 index 0000000..4c4a78e Binary files /dev/null and b/images/highlight-bg.jpg differ diff --git a/images/sidebar-bg.jpg b/images/sidebar-bg.jpg new file mode 100644 index 0000000..42890fe Binary files /dev/null and b/images/sidebar-bg.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..58904ca --- /dev/null +++ b/index.html @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + Java-utils by antonini + + + +
+
+

Java-utils

+

Java Utilities

+ View project onGitHub +
+
+ +
+
+
+

+Welcome to GitHub Pages.

+ +

This automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new branch:

+ +
$ cd your_repo_root/repo_name
+$ git fetch origin
+$ git checkout gh-pages
+
+ +

If you're using the GitHub for Mac, simply sync your repository and you'll see the new branch.

+ +

+Designer Templates

+ +

We've crafted some handsome templates for you to use. Go ahead and continue to layouts to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved if it remained markdown format.

+ +

+Rather Drive Stick?

+ +

If you prefer to not use the automatic generator, push a branch named gh-pages to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.

+ +

+Authors and Contributors

+ +

You can @mention a GitHub username to generate a link to their profile. The resulting <a> element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.

+ +

+Support or Contact

+ +

Having trouble with Pages? Check out the documentation at http://help.github.com/pages or contact support@github.com and we’ll help you sort it out.

+
+ + +
+
+ + + + \ No newline at end of file diff --git a/javascripts/main.js b/javascripts/main.js new file mode 100644 index 0000000..d8135d3 --- /dev/null +++ b/javascripts/main.js @@ -0,0 +1 @@ +console.log('This would be the main JS file.'); diff --git a/params.json b/params.json new file mode 100644 index 0000000..4b2e685 --- /dev/null +++ b/params.json @@ -0,0 +1 @@ +{"name":"Java-utils","tagline":"Java Utilities","body":"### Welcome to GitHub Pages.\r\nThis automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new branch:\r\n\r\n```\r\n$ cd your_repo_root/repo_name\r\n$ git fetch origin\r\n$ git checkout gh-pages\r\n```\r\n\r\nIf you're using the GitHub for Mac, simply sync your repository and you'll see the new branch.\r\n\r\n### Designer Templates\r\nWe've crafted some handsome templates for you to use. Go ahead and continue to layouts to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved if it remained markdown format.\r\n\r\n### Rather Drive Stick?\r\nIf you prefer to not use the automatic generator, push a branch named `gh-pages` to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.\r\n\r\n### Authors and Contributors\r\nYou can @mention a GitHub username to generate a link to their profile. The resulting `` element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.\r\n\r\n### Support or Contact\r\nHaving trouble with Pages? Check out the documentation at http://help.github.com/pages or contact support@github.com and we’ll help you sort it out.\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file diff --git a/pom.xml b/pom.xml deleted file mode 100644 index f1054c5..0000000 --- a/pom.xml +++ /dev/null @@ -1,351 +0,0 @@ - - 4.0.0 - - com.eidoscode.utils - java-utils - 1.1.1-SNAPSHOT - jar - - Java Utils - The purpose of this component is to provide some utility classes on Java. It was designed to use it as a dependency of your project. - http://libs.eidoscode.com/java-utils/ - - 2012 - - - UTF-8 - - - - scm:git:https://github.com/eidoscode/java-utils.git - scm:git:https://github.com/eidoscode/java-utils.git - https://github.com/eidoscode/java-utils - HEAD - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - - - - - GitHub - https://github.com/eidoscode/java-utils/issues - - - - - junit - junit - 4.12 - test - - - log4j - log4j - 1.2.17 - - - - - - antonini - Endrigo Antonini - http://www.endrigo.com.br/ - - Developer - - - - - - - eidoscode-mvn-repository - scp://eidoscode.com/deploy/maven2/releases/ - - - eidoscode-mvn-repository - scp://eidoscode.com/deploy/maven2/snapshots/ - true - - - eidoscode-mvn-repository - scp://eidoscode.com/deploy/site/java-utils/${project.version} - - - - - - - - org.apache.maven.wagon - wagon-webdav-jackrabbit - 2.7 - - - org.apache.maven.wagon - wagon-ssh - 2.7 - - - - - - maven-antrun-plugin - 1.8 - - - maven-surefire-plugin - 2.18.1 - - - maven-jar-plugin - 2.5 - - - maven-resources-plugin - 2.7 - - - maven-install-plugin - 2.5.2 - - - maven-clean-plugin - 2.6.1 - - - maven-assembly-plugin - 2.5.3 - - - maven-dependency-plugin - 2.10 - - - maven-release-plugin - 2.5.1 - - - maven-javadoc-plugin - 2.10.3 - - true - true - ${basedir}/src/main/javadoc/package.html - Generic Utils - Generic Utils - - http://www.eidoscode.com/ - - - - - - - - maven-compiler-plugin - 3.3 - - 1.7 - 1.7 - - - - maven-source-plugin - 2.4 - - - - jar - - - - - - maven-release-plugin - 2.5.1 - - - maven-deploy-plugin - 2.8.2 - - - deploy - deploy - - deploy - - - - - - - maven-site-plugin - 3.4 - - - - - - package - - site - - - - - - - - - maven-cobertura-plugin - - - - - - org.codehaus.mojo - l10n-maven-plugin - 1.0-alpha-2 - - - en - fr - pt_BR - - - - - maven-project-info-reports-plugin - 2.8 - - - - index - summary - dependencies - dependency-convergence - dependency-info - dependency-management - issue-tracking - license - modules - plugin-management - plugins - project-team - scm - - - - - - maven-jxr-plugin - 2.5 - - - org.codehaus.mojo - cobertura-maven-plugin - 2.6 - - - html - xml - - - - - maven-changes-plugin - 2.11 - - Id,Type,Summary,Assignee,Status,Fix Version - true - false - https - 443 - - - - - changes-report - github-report - - - - - - org.codehaus.mojo - findbugs-maven-plugin - 3.0.1 - - - org.codehaus.mojo - taglist-maven-plugin - 2.4 - - true - - - - Todo Work - - - todo - ignoreCase - - - @todo - ignoreCase - - - FIXME - exact - - - - - Review Work - - - XXX - ignoreCase - - - - - Deprecated Work - - - @deprecated - exact - - - - - Printing without LOG (SYSOUT, printStackTrace) - - - System.out - exact - - - printStackTrace - exact - - - - - - - - - org.codehaus.mojo - versions-maven-plugin - 2.2 - - - - \ No newline at end of file diff --git a/src/changes/changes.xml b/src/changes/changes.xml deleted file mode 100644 index 862c8dc..0000000 --- a/src/changes/changes.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - Release Notes - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/com/eidoscode/util/collection/CollectionsUtils.java b/src/main/java/com/eidoscode/util/collection/CollectionsUtils.java deleted file mode 100644 index 7f7f743..0000000 --- a/src/main/java/com/eidoscode/util/collection/CollectionsUtils.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.eidoscode.util.collection; - -import java.util.ArrayList; -import java.util.Collection; - -/** - * Utilities classes to be used with collections. - * - * @author antonini - * @since 1.0 - * @version 1.0 - */ -public final class CollectionsUtils { - - private CollectionsUtils() { - } - - /** - * Filter an {@link Collection} using an {@link Predicate} instance.
- * Example: The sample below is going to return a {@link Collection} that - * inside of it, it'll have just a single instance of a String "A Object". - * - *
-	 * {@link ArrayList}<String> list = new ArrayList<String>();
-	 * list.add("A Object");
-	 * list.add("B Object");
-	 * 
-	 * {@link Collection}<String> b = CollectionsUtils.filter(list, new {@link Predicate}<String>() {
-	 * 
-	 * 	public boolean apply(String type) {
-	 * 		return (type.charAt(0) == 'A');
-	 * 	};
-	 * });
-	 * 
- * - * @param source - * Collection source to be filtered. This field is mandatory, if - * you don't send it, it'll generate an - * {@link NullPointerException}. - * @param predicate - * Instance of the predicate to be used to apply the filter. This - * field is mandatory, if you don't send it, it'll generate an - * {@link NullPointerException}. - * @return It'll returns an Collection instance filtered by the predicate. - * If the source or the predicate passed - * through parameter is null, it'll throw a - * {@link NullPointerException}. - */ - public static Collection filter(Collection source, - Predicate predicate) { - if (source == null) { - throw new NullPointerException("The source is mandatory."); - } - if (predicate == null) { - throw new NullPointerException("The predicate is mandatory."); - } - - Collection result = new ArrayList(); - if (source.size() > 0) { - for (T element : source) { - if (predicate.apply(element)) { - result.add(element); - } - } - } - return result; - } - -} diff --git a/src/main/java/com/eidoscode/util/collection/Predicate.java b/src/main/java/com/eidoscode/util/collection/Predicate.java deleted file mode 100644 index 9e58999..0000000 --- a/src/main/java/com/eidoscode/util/collection/Predicate.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.eidoscode.util.collection; - -/** - * Used to judge an object.
- * - * @see CollectionsUtils - * @author antonini - * @since 1.0 - * @version 1.0 - */ -public interface Predicate { - - /** - * Method to be implemented to qualify an object. - * - * @param type - * Object that is going to be qualified. - * @return true If the qualification passed, false - * if don't. - */ - boolean apply(T type); -} diff --git a/src/main/java/com/eidoscode/util/collection/package-info.java b/src/main/java/com/eidoscode/util/collection/package-info.java deleted file mode 100644 index c1b968a..0000000 --- a/src/main/java/com/eidoscode/util/collection/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * - * Package containing classes to help working with Collections. - * - * @author antonini - * @since 1.0 - * @version 1.0 - */ -package com.eidoscode.util.collection; diff --git a/src/main/java/com/eidoscode/util/concurrency/LockGenerator.java b/src/main/java/com/eidoscode/util/concurrency/LockGenerator.java deleted file mode 100644 index 04f6833..0000000 --- a/src/main/java/com/eidoscode/util/concurrency/LockGenerator.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.eidoscode.util.concurrency; - -import java.util.concurrent.ConcurrentHashMap; - -/** - * The purpose of this class is to generate a lock object so it can be used on - * the synchronization of threads. This generates a unique sync object according - * the provided unique key.
- * This is a nice way to control a bunch of services that impact each other if - * they are using the same record or peace of data, so those services, if are - * processing other information they will run simultaneously.
- *
- * Example:
- * Let's say that you have a data called A and B. And you have two different - * services. One import the data and the other export the data. Those services - * are independent but you have to make sure that you are not reading the object - * while someone is writing on the same object. At the same time, if those - * services read and write different information they can run in parallel.
- * Scenario 1:
- * Service A and B needs the Object X.
- *
  • Service A: Generates a lock using the LockGenerator class.
  • Service B: - * Generates a lock using the LockGenerator class.
  • Service A: Synchronized - * using the generated object and receive the lock so it can run.
  • Service B: - * Synchronize using the generated object (same as the above) but it don't - * receive the lock, so it wait for the lock acquisition.
  • Service A: Do a - * lot of stuff on the Object X.
  • Service B: Waiting for the lock.
  • - * Service A: Release the lock object.
  • Service B: Receive the lock status so - * it can start working.
  • Service A: Start doing other stuff.
  • Service B: - * Release the lock object.
    - * Result: As you can see, as both Services want to use same Object, the lock - * each other.
    - *
    - *
    - * Scenario 2:
    - * Service A needs te Object X and B needs the Object Y.
  • Service A: - * Generates a lock using the LockGenerator class.
  • Service B: Generates a - * lock using the LockGenerator class.
  • Service A: Synchronized using the - * generated object and receive the lock so it can run.
  • Service B: - * Synchronized using the generated object and receive the lock so it can run. - *
  • Service A: Do a lot of stuff on the Object X.
  • Service B: Do a lot of - * stuff on the Object Y.
  • Service A: Release the lock object.
  • - * Service B: Release the lock object.
  • Service A: Start doing other stuff. - *
  • Service B: Start doing other stuff.
    - *
    - * - * @author antonini - * @since 1.1.0 - * @version 1.0 - */ -public final class LockGenerator { - - private static final ConcurrentHashMap LOCKS = new ConcurrentHashMap(); - - private static final Object LOCK_OBJECT = new Object(); - - private LockGenerator() { - } - - /** - * Generates or retrieve a lock object according a given key. - * - * @param key - * Key of the generated lock object. - * @return Lock Object. - */ - public static Object lockObject(final String key) { - LockObject lock = LOCKS.get(key); - if (lock == null) { - synchronized (LOCK_OBJECT) { - lock = new LockObject(); - final LockObject oldLock = LOCKS.putIfAbsent(key, lock); - if (oldLock != null) { - lock = oldLock; - } - } - } - lock.count++; - return lock; - } - - /** - * Release the Lock object. The main reason of this method is to ensure that - * the JVM memory will be cleaned after all the threads use the lock object - * avoiding a memory leak. - * - * @param key - * Key of the generated lock object. - */ - public static void releaseLock(final String key) { - LockObject lock = LOCKS.get(key); - if (lock != null) { - lock.count--; - if (lock.count <= 0) { - synchronized (lock) { - if (lock.count <= 0) { - LOCKS.remove(key); - } - } - } - } - } - - /** - * Retrieve the amount of requests that was made by a given key. This helps - * you to check if your Thread control is satisfying your needs. - * - * @param key - * Key of the generated lock object. - * @return The amount of request that was made by the given key. If -1 means - * that no one has already requested for that key. - */ - public static int getConcurrentInUse(final String key) { - LockObject lock = LOCKS.get(key); - if (lock == null) { - return -1; - } - return lock.count; - } -} - -/** - * Lock Object. - * - * @author antonini - * @since 1.1.0 - * @version 1.0 - */ -class LockObject { - - protected int count = 0; - -} \ No newline at end of file diff --git a/src/main/java/com/eidoscode/util/concurrency/package-info.java b/src/main/java/com/eidoscode/util/concurrency/package-info.java deleted file mode 100644 index 4871e27..0000000 --- a/src/main/java/com/eidoscode/util/concurrency/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * - * Package containing classes to help to work with concurrency. - * - * @author antonini - * @since 1.1.0 - * @version 1.0 - */ -package com.eidoscode.util.concurrency; diff --git a/src/main/java/com/eidoscode/util/io/CompressUtils.java b/src/main/java/com/eidoscode/util/io/CompressUtils.java deleted file mode 100644 index 2228d43..0000000 --- a/src/main/java/com/eidoscode/util/io/CompressUtils.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.eidoscode.util.io; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Enumeration; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; -import java.util.zip.ZipInputStream; -import java.util.zip.ZipOutputStream; - -import org.apache.log4j.Logger; - -/** - * Utility class with functions to work with compacted files. - * - * @author antonini - * @since 1.1.0 - * @version 1.0 - * - */ -public final class CompressUtils { - - private static final Logger LOG = Logger.getLogger(CompressUtils.class); - - /** - * Hide the constructor. - */ - private CompressUtils() { - } - - /** - * It extract all files from a ZIP File to destiny path.
    - * Prefer to use the method - * - * @param zippedFile - * zipped file. - * @param fileDestiny - * path where the files are saved. - * @throws IOException - * when an error occurs. - */ - public static void extractZipFile(File zippedFile, File fileDestiny) throws IOException { - InputStream input = null; - input = new FileInputStream(zippedFile); - extractZipFile(input, fileDestiny); - } - - /** - * It extract all files from a ZIP File to destiny path. - * - * @param input - * InputStream of the Zip file. - * @param destiny - * path where the files are saved. - * @throws IOException - * when an error occurs. - */ - public static void extractZipFile(InputStream input, File destiny) throws IOException { - ZipEntry entry = null; - ZipInputStream zinputStream = null; - - zinputStream = new ZipInputStream(new BufferedInputStream(input)); - - while ((entry = zinputStream.getNextEntry()) != null) { - - if (entry.isDirectory()) { - String currentEntry = entry.getName(); - File destFile = new File(destiny, currentEntry); - destFile.mkdirs(); - - } else { - String currentEntry = entry.getName(); - - File destFile = new File(destiny, currentEntry); - File destinationParent = destFile.getParentFile(); - - // create the parent directory structure if needed - destinationParent.mkdirs(); - - LOG.debug("Extracting: " + entry); - - int count; - byte data[] = new byte[StreamUtils.BUFFER_BYTES]; - FileOutputStream fos = new FileOutputStream(destFile); - BufferedOutputStream dest = new BufferedOutputStream(fos, StreamUtils.BUFFER_BYTES); - while ((count = zinputStream.read(data, 0, StreamUtils.BUFFER_BYTES)) != -1) { - dest.write(data, 0, count); - } - dest.flush(); - StreamUtils.closeSilently(dest); - } - } - StreamUtils.closeSilently(zinputStream); - } - - public static File toZip(final File zipFile, com.eidoscode.util.io.zip.ZipEntry... files) throws IOException { - int cont; - byte[] data = new byte[StreamUtils.BUFFER_BYTES]; - - if (zipFile.exists()) { - zipFile.delete(); - } - - final File tempReadingFile = File.createTempFile("tmp-", "-" + zipFile.getName()); - - if (tempReadingFile.delete()) { - BufferedInputStream source = null; - FileInputStream streamSource = null; - ZipEntry entry = null; - - final File tempWritingFile = File.createTempFile("tmp-", ".w.dat"); - tempWritingFile.delete(); - - ZipOutputStream append = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(tempWritingFile))); - - if (zipFile.exists()) { - - FileUtils.moveFile(zipFile, tempReadingFile, true); - - ZipFile zip = new ZipFile(tempReadingFile); - - Enumeration entries = zip.entries(); - while (entries.hasMoreElements()) { - ZipEntry e = entries.nextElement(); - LOG.debug("Copy: " + e.getName()); - append.putNextEntry(e); - if (!e.isDirectory()) { - StreamUtils.copyStream(zip.getInputStream(e), append, false, false); - } - } - - StreamUtils.closeSilently(zip); - } - - for (com.eidoscode.util.io.zip.ZipEntry file : files) { - LOG.debug(file.getFile()); - streamSource = new FileInputStream(file.getFile()); - source = new BufferedInputStream(streamSource, StreamUtils.BUFFER_BYTES); - entry = new ZipEntry(file.getRelativePath()); - LOG.debug("Adding: " + file.getRelativePath()); - - append.putNextEntry(entry); - - while ((cont = source.read(data, 0, StreamUtils.BUFFER_BYTES)) != -1) { - append.write(data, 0, cont); - } - StreamUtils.closeSilently(source); - } - - StreamUtils.closeSilently(append); - - tempReadingFile.delete(); - FileUtils.moveFile(tempWritingFile, zipFile, true); - } - return zipFile; - } - -} diff --git a/src/main/java/com/eidoscode/util/io/FileUtils.java b/src/main/java/com/eidoscode/util/io/FileUtils.java deleted file mode 100644 index 1560b91..0000000 --- a/src/main/java/com/eidoscode/util/io/FileUtils.java +++ /dev/null @@ -1,229 +0,0 @@ -package com.eidoscode.util.io; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.RandomAccessFile; - -import org.apache.log4j.Logger; - -/** - * Utility class with the purpose to group a lot of functionalities to use with - * files. Such as copy, move or save a content on a given file. - * - * @author antonini - * @since 1.1.0 - * @version 1.0 - * - */ -public final class FileUtils { - - private static final Logger LOG = Logger.getLogger(FileUtils.class); - - /** - * Hide the constructor. - */ - private FileUtils() { - } - - /** - * It moves a file from a origin to a destination. It will not try to - * overwrite the destination file if it already exists. - * - * @param origin - * Origin file. - * @param destination - * Destination file. - * @return true if it was moved. - * @throws IOException - * Throws if the destination file already exists and it was not - * selected to overwrite it. - * @throws NullPointerException - * Throws if the origin of the destination parameter is null. - */ - public static boolean moveFile(File origin, File destination) throws IOException { - return moveFile(origin, destination, false); - } - - /** - * It moves a file from a origin to a destination. It's possible to overwrite - * a current file. - * - * @param origin - * Origin file. - * @param destination - * Destination file. - * @param overwrite - * true if you want to overwrite the destination file. - * @return true if it was moved. Otherwise false. - * @throws IOException - * Throws if the destination file already exists and it was not - * selected to overwrite it. - * @throws NullPointerException - * Throws if the origin of the destination parameter is null. - */ - public static boolean moveFile(File origin, File destination, boolean overwrite) throws IOException { - if (origin == null || !origin.exists()) { - throw new NullPointerException("The origin file is mandatory to exists."); - } - if (destination == null) { - throw new NullPointerException("The destination file is mandatory."); - } - - if (destination.exists() && !overwrite) { - throw new IOException("The destination file already exists and it was chosed to not overwrite it."); - } - - if (destination.exists()) { - boolean deleted = destination.delete(); - LOG.debug("Deleted the destination file? " + deleted); - } - - boolean moved = origin.renameTo(destination); - LOG.debug("Moved the file \"" + origin + "\" to \"" + destination + "\" using Java API? " + moved); - - if (!moved) { - LOG.debug("As it was not possible to move it by the JAVA native API it will try to copy the file and delete the original file."); - copyFile(origin, destination); - boolean deleted = origin.delete(); - LOG.debug("File copied. Origin filed was deleted? " + deleted); - } - - moved = destination.exists(); - LOG.debug("Moved the file \"" + origin + "\" to \"" + destination + "\"? " + moved + " (method return)"); - return moved; - } - - /** - * This function read a File and returns its byte[]; - * - * @param file - * the name of the file - * @return byte array of file - * @throws FileNotFoundException - * @throws IOException - * @throws IOException - * Throws if there is any problem reading the given file. - * @throws NullPointerException - * Throws if the file parameter is null. - * - */ - public static byte[] readFileToByteArray(File file) throws FileNotFoundException, IOException { - if (file == null || !file.exists()) { - throw new NullPointerException("The file is mandatory to exists."); - } - byte[] byteArray = null; - - RandomAccessFile raf = new RandomAccessFile(file, "r"); - byteArray = new byte[(int) raf.length()]; - raf.read(byteArray); - StreamUtils.closeSilently(raf); - - return byteArray; - } - - /** - * this method removes a directory with or without files, recursively. - * - * @param file - * the directory to delete. - */ - public static void removeDirectory(File file) throws IOException { - if (file.isDirectory()) { - // validate if directory is empty, then delete it - if (file.list().length == 0) { - file.delete(); - } else { - // list all the directory contents - String files[] = file.list(); - - for (String temp : files) { - // create file to delete - File fileDelete = new File(file, temp); - - // recursive delete - removeDirectory(fileDelete); - } - - // if directory is empty, delete - if (file.list().length == 0) { - file.delete(); - } - } - - } else { - // if it's a file, delete - file.delete(); - } - } - - /** - * Copy a file to other file. - * - * @param input - * File that is going to be readed. - * @param output - * File that is going to be writed. - * @throws IOException - * if an error occurs when saving the file. - */ - public static void copyFile(File input, File output) throws IOException { - FileInputStream fis = new FileInputStream(input); - FileOutputStream fos = new FileOutputStream(output); - StreamUtils.copyStream(fis, fos); - - StreamUtils.closeSilently(fis, fos); - } - - /** - * It saves the file in the given directory and file It closes both - * connections (InputStream and Outputstream) - * - * @param input - * stream to be saved. - * @param file - * file to be persisted. - * @throws IOException - * if an error occurs when saving the file. - */ - public static File saveFile(InputStream input, File file) throws IOException { - FileOutputStream outputStream = new FileOutputStream(file); - StreamUtils.copyStream(input, outputStream); - return file; - - } - - /** - * Save a given content into a given file name - * - * @param content - * String of content to save - * @param fileName - * name of file - * @throws IOException - * if an error occur - */ - public static void saveContentIntoFile(String content, File fileName) throws IOException { - BufferedWriter writer = null; - try { - writer = new BufferedWriter(new FileWriter(fileName)); - writer.write(content); - } finally { - if (writer != null) { - StreamUtils.closeSilently(writer); - } - } - } - - public static void saveContentIntoFile(byte[] content, File fileName) throws IOException { - FileOutputStream fos = new FileOutputStream(fileName); - fos.write(content); - StreamUtils.closeSilently(fos); - } - -} diff --git a/src/main/java/com/eidoscode/util/io/StreamUtils.java b/src/main/java/com/eidoscode/util/io/StreamUtils.java deleted file mode 100644 index f158342..0000000 --- a/src/main/java/com/eidoscode/util/io/StreamUtils.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.eidoscode.util.io; - -import java.io.BufferedReader; -import java.io.Closeable; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.Reader; -import java.io.StringWriter; -import java.io.Writer; - -import javax.naming.Context; - -/** - * Utility class that it purpose is to help the user to work with Streams. - * - * @author antonini - * @since 1.1.0 - * @version 1.0 - */ -public final class StreamUtils { - - /** - * Default buffer size. - */ - public final static int BUFFER_BYTES = 1024; - private static final String DEFAULT_ENCODING = "UTF-8"; - - /** - * Hide the constructor. - */ - private StreamUtils() { - } - - /** - * Close one or more {@link AutoCloseable} objects silently. - * - * @param closeables - * varargs of {@link AutoCloseable} objects. - */ - public static void closeSilently(AutoCloseable... closeables) { - if (closeables != null) { - for (AutoCloseable closeable : closeables) { - try { - if (closeable != null) { - closeable.close(); - } - } catch (Exception e) { - } - } - } - } - - /** - * Close one or more {@link Closeable} objects silently. - * - * @param closeables - * varargs of {@link Closeable} objects. - */ - public static void closeSilently(Closeable... closeables) { - if (closeables != null) { - for (Closeable closeable : closeables) { - try { - if (closeable != null) { - closeable.close(); - } - } catch (Exception e) { - } - } - } - } - - /** - * Close one or more {@link Context} objects silently. - * - * @param closeables - * varargs of {@link Context} objects. - */ - public static void closeSilently(Context... closeables) { - if (closeables != null) { - for (Context closeable : closeables) { - try { - if (closeable != null) { - closeable.close(); - } - } catch (Exception e) { - } - } - } - } - - /** - * Return the string content from an input stream. - * - * @param input - * Input stream. - * @param encoding - * Encoding used to read the file. - * @return Result string of the input. - * @throws IOException - * Throws it if occur an error while reading the input stream. - * @throws NullPointerException - * Throws if the input stream or encoding parameters are null. - */ - public static String readContentFromInputStream(InputStream input, String encoding) throws IOException { - if (input == null) { - throw new NullPointerException("The input stream is mandatory to exists."); - } - if (encoding == null) { - throw new NullPointerException("The encoding is mandatory to exists."); - } - Writer writer = new StringWriter(); - - char[] buffer = new char[1024]; - try { - Reader reader = new BufferedReader(new InputStreamReader(input, encoding)); - int n; - while ((n = reader.read(buffer)) != -1) { - writer.write(buffer, 0, n); - } - } finally { - closeSilently(input); - } - return writer.toString(); - } - - /** - * Return the string content from an input stream. It uses the default - * encoding to read the content of the Stream. That value can be check on the - * variable {@link #DEFAULT_ENCODING} (Default value: - * {@value #DEFAULT_ENCODING}). - * - * @param input - * Input stream. - * @return Result string of the input. - * @throws IOException - * Throws it if occur an error while reading the input stream. - * @throws NullPointerException - * Throws if the input stream parameter is null. - */ - public static String readContentFromInputStream(InputStream input) throws IOException { - return readContentFromInputStream(input, DEFAULT_ENCODING); - } - - /** - * Copy the input Stream to the output stream. After the process is done it - * closes the input and output stream. - * - * @param input - * Input stream. - * @param output - * Output stream. - * @param closeInput - * true if after the process is done it will close the - * input stream. - * @param closeOutput - * true if after the process is done it will close the - * output stream. - * @throws IOException - * Throws if an error occurs when reading or saving the file. - * @throws NullPointerException - * Throws if the input or output stream parameters are null. - */ - public static void copyStream(InputStream input, OutputStream output, boolean closeInput, boolean closeOutput) throws IOException { - if (input == null) { - throw new NullPointerException("The input stream is mandatory to exists."); - } - if (output == null) { - throw new NullPointerException("The output stream is mandatory to exists."); - } - byte[] bytes = new byte[BUFFER_BYTES]; - int count; - while ((count = input.read(bytes)) > 0) { - output.write(bytes, 0, count); - output.flush(); - } - - if (closeInput) { - closeSilently(input); - } - if (closeOutput) { - closeSilently(output); - } - } - - /** - * Copy the input Stream to the output stream. After the process is done it - * closes the input and output stream. - * - * @param input - * Input stream. - * @param outputStream - * Output stream. - * @throws IOException - * Throws if an error occurs when reading or saving the file. - * @throws NullPointerException - * Throws if the input or output stream parameters are null. - */ - public static void copyStream(InputStream input, OutputStream outputStream) throws IOException { - copyStream(input, outputStream, true, true); - } - - /** - * Count the amount of bytes a given input stream contains. - * - * @param input - * Input stream. - * @return The amount of bytes of the given input stream. If 0 means that is - * empty. - * @throws IOException - * Throws it if occur an error while reading the input stream. - * @throws NullPointerException - * Throws if the input stream parameter is null. - */ - public static int countBytes(InputStream input) throws IOException { - if (input == null) { - throw new NullPointerException("The input stream is mandatory to exists."); - } - int amountBytes = 0; - int count = 0; - byte[] bytes = new byte[BUFFER_BYTES]; - while ((count = input.read(bytes)) > 0) { - amountBytes += count; - } - return amountBytes; - } -} diff --git a/src/main/java/com/eidoscode/util/io/package-info.java b/src/main/java/com/eidoscode/util/io/package-info.java deleted file mode 100644 index 7cf1f04..0000000 --- a/src/main/java/com/eidoscode/util/io/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * - * Package containing classes to help to work with I/O. - * - * @author antonini - * @since 1.1.0 - * @version 1.0 - */ -package com.eidoscode.util.io; \ No newline at end of file diff --git a/src/main/java/com/eidoscode/util/io/zip/ZipEntry.java b/src/main/java/com/eidoscode/util/io/zip/ZipEntry.java deleted file mode 100644 index c96cf35..0000000 --- a/src/main/java/com/eidoscode/util/io/zip/ZipEntry.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.eidoscode.util.io.zip; - -import java.io.File; - -/** - * Internal Zip entry. It refers to a physical file and a logical location that - * this file must be placed on the generated zip file. - * - * @author antonini - * @since 1.1.0 - * @version 1.0 - */ -public class ZipEntry { - - private String relativePath; - private File file; - - public ZipEntry() { - super(); - } - - public ZipEntry(File file, String relativePath) { - this(); - this.relativePath = relativePath; - this.file = file; - } - - public String getRelativePath() { - return relativePath; - } - - public void setRelativePath(String relativePath) { - this.relativePath = relativePath; - } - - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - -} diff --git a/src/main/java/com/eidoscode/util/io/zip/package-info.java b/src/main/java/com/eidoscode/util/io/zip/package-info.java deleted file mode 100644 index a48438c..0000000 --- a/src/main/java/com/eidoscode/util/io/zip/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * - * Package containing classes to help to work with Zip files. - * - * @author antonini - * @since 1.1.0 - * @version 1.0 - */ -package com.eidoscode.util.io.zip; \ No newline at end of file diff --git a/src/main/java/com/eidoscode/util/jaxrs/VariableStrings.java b/src/main/java/com/eidoscode/util/jaxrs/VariableStrings.java deleted file mode 100644 index cf7d05f..0000000 --- a/src/main/java/com/eidoscode/util/jaxrs/VariableStrings.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.eidoscode.util.jaxrs; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** - * Utility class designed to be used with the JAX-RS API. The purpose of it is - * to make it possible to expose an JAX-RS Path that receives an varargs - * argument.
    - * What you need to do is to overload the varargs method an use this class as it - * would be the varargs parameter. Then use the - * {@link VariableStrings#getSplitPath()} to send the value to the original - * method. - * - * @author antonini - * @since 1.0.1 - * @version 1.0 - */ -public class VariableStrings { - - private final List splitPath; - - public VariableStrings(String unparsedPath) { - if (unparsedPath == null) { - throw new NullPointerException("The parameter is mandatory."); - } - String[] paths = unparsedPath.split("/"); - splitPath = Collections.unmodifiableList(Arrays.asList(paths)); - } - - /** - * Returns the List of string split by the slash ("/"). - * - * @return - */ - public List getSplitPaths() { - return splitPath; - } - -} diff --git a/src/main/java/com/eidoscode/util/jaxrs/package-info.java b/src/main/java/com/eidoscode/util/jaxrs/package-info.java deleted file mode 100644 index f89bfd9..0000000 --- a/src/main/java/com/eidoscode/util/jaxrs/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * - * Package containing classes to help to work with JAX-RS. - * - * @author antonini - * @since 1.0.1 - * @version 1.0 - */ -package com.eidoscode.util.jaxrs; diff --git a/src/main/java/com/eidoscode/util/resource/BufferedReaderPrivilegedExceptionAction.java b/src/main/java/com/eidoscode/util/resource/BufferedReaderPrivilegedExceptionAction.java deleted file mode 100644 index d4e6836..0000000 --- a/src/main/java/com/eidoscode/util/resource/BufferedReaderPrivilegedExceptionAction.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.eidoscode.util.resource; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URL; -import java.net.URLConnection; -import java.security.PrivilegedExceptionAction; - -/** - * - * The purpose of this class is to be a helper class that is going to be used - * with privileges. This is going to be used with the {@link EncodingControl}. - * - * @author antonini - * @since 1.0.3 - * @version 1.0 - * - */ -class BufferedReaderPrivilegedExceptionAction implements - PrivilegedExceptionAction { - - protected final boolean reloadFlag; - protected final ClassLoader classLoader; - protected final String resourceName; - protected final String encoding; - - /** - * Main constructor. - * - * @param reloadFlag - * If the Bundle had been reloaded. - * @param classLoader - * Class loader. - * @param resourceName - * Resource name. - * @param encoding - * Encoding. - */ - public BufferedReaderPrivilegedExceptionAction(boolean reloadFlag, - ClassLoader classLoader, String resourceName, String encoding) { - super(); - this.reloadFlag = reloadFlag; - this.classLoader = classLoader; - this.resourceName = resourceName; - this.encoding = encoding; - } - - /** - * Run the class and returns the {@link BufferedReader} or null. - */ - @Override - public BufferedReader run() throws IOException { - BufferedReader br = null; - InputStream is = null; - if (reloadFlag) { - URL url = classLoader.getResource(resourceName); - if (url != null) { - URLConnection connection = url.openConnection(); - if (connection != null) { - connection.setUseCaches(false); - is = connection.getInputStream(); - } - } - } else { - is = classLoader.getResourceAsStream(resourceName); - } - - if (is != null) { - br = new BufferedReader(new InputStreamReader(is, encoding)); - } - return br; - } -} diff --git a/src/main/java/com/eidoscode/util/resource/EncodingControl.java b/src/main/java/com/eidoscode/util/resource/EncodingControl.java deleted file mode 100644 index d6f7d00..0000000 --- a/src/main/java/com/eidoscode/util/resource/EncodingControl.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.eidoscode.util.resource; - -import java.io.BufferedReader; -import java.io.IOException; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.util.Locale; -import java.util.PropertyResourceBundle; -import java.util.ResourceBundle; - -/** - * The purpose of this class is to make possible to use the - * {@link ResourceBundle} static methods to read properties files that are - * written on any encoding. It's necessary to send it through parameter what - * encoding you want to use. - * - * @author antonini - * @since 1.0.3 - * @version 1.0 - */ -public class EncodingControl extends java.util.ResourceBundle.Control { - - public static final String FORMAT_FILE = "java.properties"; - private static final String FILE_SUFFIX = "properties"; - - final String encoding; - - /** - * Main constructor. - * - * @param encoding - */ - public EncodingControl(String encoding) { - super(); - this.encoding = encoding; - } - - @Override - public ResourceBundle newBundle(String baseName, Locale locale, - String format, ClassLoader loader, boolean reload) - throws IllegalAccessException, InstantiationException, IOException { - - if ((baseName == null) || (locale == null) || (format == null) - || (loader == null)) { - throw new NullPointerException(); - } - - String bundleName = toBundleName(baseName, locale); - ResourceBundle bundle = null; - - if (FORMAT_FILE.equals(format)) { - final String resourceName = toResourceName(bundleName, FILE_SUFFIX); - BufferedReader stream = null; - try { - PrivilegedExceptionAction privilegedExceptionAction = new BufferedReaderPrivilegedExceptionAction( - reload, loader, resourceName, encoding); - - stream = AccessController - .doPrivileged(privilegedExceptionAction); - } catch (PrivilegedActionException e) { - throw (IOException) e.getException(); - } - if (stream != null) { - try { - bundle = new PropertyResourceBundle(stream); - } finally { - stream.close(); - } - } - } else { - bundle = super.newBundle(baseName, locale, format, loader, reload); - } - return bundle; - } -} diff --git a/src/main/java/com/eidoscode/util/resource/package-info.java b/src/main/java/com/eidoscode/util/resource/package-info.java deleted file mode 100644 index f0a2db4..0000000 --- a/src/main/java/com/eidoscode/util/resource/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/** - * - * Package containing classes to help to work with {@link java.util.ResourceBundle} and a specific encoding. - * - * @author antonini - * @since 1.0.4 - * @version 1.0 - */ -package com.eidoscode.util.resource; - diff --git a/src/site/fml/faq.fml b/src/site/fml/faq.fml deleted file mode 100644 index d27c88e..0000000 --- a/src/site/fml/faq.fml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - General - - - - What is Foo? - - -

    some markup goes here

    - - some source code - -

    some markup goes here

    -
    -
    - - - - What is Bar? - - -

    some markup goes here

    -
    -
    -
    - - - - Installation - - - - How do I install Foo? - - -

    some markup goes here

    -
    -
    - -
    - -
    \ No newline at end of file diff --git a/src/site/site.xml b/src/site/site.xml deleted file mode 100644 index 9adac67..0000000 --- a/src/site/site.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - org.apache.maven.skins - maven-fluido-skin - 1.3.0 - - - - false - true - - - - Java Utils - - http://libraries.endrigo.com.br/java-utils/ - - - EidosCode - - - - - - - - - - - diff --git a/src/test/java/com/eidoscode/util/collection/test/CollectionUtilsFilterTest.java b/src/test/java/com/eidoscode/util/collection/test/CollectionUtilsFilterTest.java deleted file mode 100644 index bf4dab8..0000000 --- a/src/test/java/com/eidoscode/util/collection/test/CollectionUtilsFilterTest.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.eidoscode.util.collection.test; - -import static org.junit.Assert.assertEquals; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.junit.Ignore; -import org.junit.Test; - -import com.eidoscode.util.collection.CollectionsUtils; -import com.eidoscode.util.collection.Predicate; - -/** - * Unit test to check the method - * {@link CollectionsUtils#filter(Collection, Predicate)}. - * - * @author antonini - * @since 1.0 - * @version 1.0 - */ -public class CollectionUtilsFilterTest { - - @Test(expected = IllegalAccessException.class) - public void testFailConstructor() throws NoSuchMethodException, - SecurityException, InstantiationException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException { - Constructor constructor = CollectionsUtils.class - .getDeclaredConstructor(); - // constructor.setAccessible(true); - constructor.newInstance(); - } - - @Test - public void testGiveConstructorAccess() throws NoSuchMethodException, - SecurityException, InstantiationException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException { - Constructor constructor = CollectionsUtils.class - .getDeclaredConstructor(); - constructor.setAccessible(true); - constructor.newInstance(); - } - - @Test(expected = NullPointerException.class) - public void testFilterNPESource() { - CollectionsUtils.filter(null, null); - } - - @Test(expected = NullPointerException.class) - public void testFilterNPEPredicate() { - CollectionsUtils.filter(getList(), null); - } - - @Test - public void testFilterReturnZero() { - Collection b = CollectionsUtils.filter(getList(), - new Predicate() { - - @Override - public boolean apply(String type) { - return false; - - }; - }); - assertEquals(0, b.size()); - } - - @Test - public void testFilterBlankList() { - Collection b = CollectionsUtils.filter(new ArrayList(), - new Predicate() { - - @Override - public boolean apply(String type) { - return false; - - }; - }); - assertEquals(0, b.size()); - } - - @Test - public void testFilterPassAll() { - List list = getList(); - long result = list.size(); - Collection b = CollectionsUtils.filter(list, - new Predicate() { - - @Override - public boolean apply(String type) { - return true; - - }; - }); - assertEquals(result, b.size()); - } - - @Test - public void testFilterJustObjectStartByA() { - ArrayList list = new ArrayList(); - list.add("AA1"); - list.add("AA2"); - list.add("AA3"); - list.add("AA4"); - list.add("AA5"); - list.add("AA6"); - list.add("BA1"); - list.add("BA2"); - list.add("BA3"); - list.add("BA4"); - list.add("BA5"); - list.add("BA6"); - - Collection b = CollectionsUtils.filter(list, - new Predicate() { - - @Override - public boolean apply(String type) { - return (type.charAt(0) == 'A'); - - }; - }); - assertEquals(6, b.size()); - } - - @Ignore - public ArrayList getList() { - ArrayList list = new ArrayList(); - list.add("AA1"); - list.add("AA2"); - list.add("AA3"); - list.add("AA4"); - list.add("AA5"); - list.add("AA6"); - list.add("BA1"); - list.add("BA2"); - list.add("BA3"); - list.add("BA4"); - list.add("BA5"); - list.add("BA6"); - return list; - } - -} diff --git a/src/test/java/com/eidoscode/util/concurrency/test/LockGeneratorTest.java b/src/test/java/com/eidoscode/util/concurrency/test/LockGeneratorTest.java deleted file mode 100644 index 2ac3d96..0000000 --- a/src/test/java/com/eidoscode/util/concurrency/test/LockGeneratorTest.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.eidoscode.util.concurrency.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.Test; - -import com.eidoscode.util.concurrency.LockGenerator; - -public class LockGeneratorTest { - - @Test - public void testGettingSimpleLock() { - final String key = "key"; - Object lock = LockGenerator.lockObject(key); - assertNotNull(lock); - LockGenerator.releaseLock(key); - } - - @Test - public void testGettingObject() { - final String key = "gettingLotOfTimeKey"; - - final Object lock1 = LockGenerator.lockObject(key); - final Object lock2 = LockGenerator.lockObject(key); - final Object lock3 = LockGenerator.lockObject(key); - - assertEquals(lock1, lock2); - assertEquals(lock2, lock3); - assertEquals(lock1, lock3); - - LockGenerator.releaseLock(key); - LockGenerator.releaseLock(key); - LockGenerator.releaseLock(key); - - int amount = LockGenerator.getConcurrentInUse(key); - assertEquals(amount, -1); - } - - @Test - public void testReleaseObjectNotRequested() { - final String key = "releaseObjectNotRequested"; - LockGenerator.releaseLock(key); - } - - @Test - public void testGettingSameKeyLock() { - final String key = "sameKey"; - final String key2 = "sameKey"; - Object lock = LockGenerator.lockObject(key); - assertNotNull(lock); - Object lock2 = LockGenerator.lockObject(key2); - assertNotNull(lock2); - assertEquals(lock, lock2); - LockGenerator.releaseLock(key); - LockGenerator.releaseLock(key); - } - - @Test - public void testAmountOfRequestsNegative() { - final String key = "testAmountOfRequestsNegative"; - int amount = LockGenerator.getConcurrentInUse(key); - assertEquals(amount, -1); - } - - @Test - public void testAmountOfRequestsPositive() { - final String key = "testKeys"; - LockGenerator.lockObject(key); - int amount = LockGenerator.getConcurrentInUse(key); - assertEquals(amount, 1); - LockGenerator.releaseLock(key); - } -} diff --git a/src/test/java/com/eidoscode/util/jaxrs/test/VariableStringsTest.java b/src/test/java/com/eidoscode/util/jaxrs/test/VariableStringsTest.java deleted file mode 100644 index 17e5736..0000000 --- a/src/test/java/com/eidoscode/util/jaxrs/test/VariableStringsTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.eidoscode.util.jaxrs.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.List; - -import org.junit.Test; - -import com.eidoscode.util.jaxrs.VariableStrings; - -public class VariableStringsTest { - - @Test - public void testSplitPaths() { - String sPaths = "param1/param2"; - VariableStrings vars = new VariableStrings(sPaths); - List paths = vars.getSplitPaths(); - - assertNotNull(paths); - assertEquals(2, paths.size()); - } - - @Test(expected = NullPointerException.class) - public void testSplitNull() { - String sPaths = null; - new VariableStrings(sPaths); - } - -} diff --git a/src/test/java/com/eidoscode/util/resource/test/EncodingControlTest.java b/src/test/java/com/eidoscode/util/resource/test/EncodingControlTest.java deleted file mode 100644 index 0581ac6..0000000 --- a/src/test/java/com/eidoscode/util/resource/test/EncodingControlTest.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.eidoscode.util.resource.test; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.util.Locale; -import java.util.ResourceBundle; - -import org.junit.Test; - -import com.eidoscode.util.resource.EncodingControl; - -/** - * Unit test of the {@link EncodingControl}. - * - * @author antonini - * @since 1.0.3 - * @version 1.0 - * - */ -public class EncodingControlTest { - - private static final Locale US = Locale.US; - private static final Locale BRAZIL = new Locale("pt", "BR"); - private static final EncodingControl ENCODING_UTF8 = genEncoding("UTF-8"); - private static final EncodingControl ENCODING_ISO88591 = genEncoding("ISO-8859-1"); - - private static final String BUNDLE_FILE_UTF8 = "messages_utf8"; - private static final String BUNDLE_FILE_ISO88591 = "messages_iso88591"; - - private static final String BUNDLE_KEY = "testMessage"; - - private static final String SPECTED_STRING = "Message with special char like 'ç', 'ã', 'õ' and 'ï',"; - - @Test - public void testEncoding() { - checkBundle(BUNDLE_FILE_UTF8, US, ENCODING_UTF8, BUNDLE_KEY); - checkBundle(BUNDLE_FILE_ISO88591, BRAZIL, ENCODING_ISO88591, BUNDLE_KEY); - } - - @Test(expected = NullPointerException.class) - public void testNullPointer1() throws IllegalAccessException, - InstantiationException, IOException { - ENCODING_UTF8.newBundle(null, US, "format", Thread.currentThread() - .getContextClassLoader(), true); - } - - @Test(expected = NullPointerException.class) - public void testNullPointer2() throws IllegalAccessException, - InstantiationException, IOException { - ENCODING_UTF8.newBundle("base", null, "format", Thread.currentThread() - .getContextClassLoader(), true); - } - - @Test(expected = NullPointerException.class) - public void testNullPointer3() throws IllegalAccessException, - InstantiationException, IOException { - ENCODING_UTF8.newBundle("base", US, null, Thread.currentThread() - .getContextClassLoader(), true); - } - - @Test(expected = NullPointerException.class) - public void testNullPointer4() throws IllegalAccessException, - InstantiationException, IOException { - ENCODING_UTF8.newBundle("base", US, "format", null, true); - } - - private void checkBundle(String bundleFile, Locale locale, - EncodingControl control, String bundleKey) { - ResourceBundle labels = ResourceBundle.getBundle(bundleFile, locale, - control); - String result = labels.getString(bundleKey); - - assertEquals(SPECTED_STRING, result); - System.out.println(result); - } - - private static EncodingControl genEncoding(String encoding) { - return new EncodingControl(encoding); - } - -} diff --git a/src/test/resources/messages_iso88591.properties b/src/test/resources/messages_iso88591.properties deleted file mode 100644 index d65ed26..0000000 --- a/src/test/resources/messages_iso88591.properties +++ /dev/null @@ -1 +0,0 @@ -testMessage=Message with special char like 'ç', 'ã', 'õ' and 'ï', \ No newline at end of file diff --git a/src/test/resources/messages_utf8.properties b/src/test/resources/messages_utf8.properties deleted file mode 100644 index ead3c92..0000000 --- a/src/test/resources/messages_utf8.properties +++ /dev/null @@ -1 +0,0 @@ -testMessage=Message with special char like 'ç', 'ã', 'õ' and 'ï', \ No newline at end of file diff --git a/stylesheets/print.css b/stylesheets/print.css new file mode 100644 index 0000000..541695b --- /dev/null +++ b/stylesheets/print.css @@ -0,0 +1,226 @@ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +body { + font-size: 13px; + line-height: 1.5; + font-family: 'Helvetica Neue', Helvetica, Arial, serif; + color: #000; +} + +a { + color: #d5000d; + font-weight: bold; +} + +header { + padding-top: 35px; + padding-bottom: 10px; +} + +header h1 { + font-weight: bold; + letter-spacing: -1px; + font-size: 48px; + color: #303030; + line-height: 1.2; +} + +header h2 { + letter-spacing: -1px; + font-size: 24px; + color: #aaa; + font-weight: normal; + line-height: 1.3; +} +#downloads { + display: none; +} +#main_content { + padding-top: 20px; +} + +code, pre { + font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal; + color: #222; + margin-bottom: 30px; + font-size: 12px; +} + +code { + padding: 0 3px; +} + +pre { + border: solid 1px #ddd; + padding: 20px; + overflow: auto; +} +pre code { + padding: 0; +} + +ul, ol, dl { + margin-bottom: 20px; +} + + +/* COMMON STYLES */ + +table { + width: 100%; + border: 1px solid #ebebeb; +} + +th { + font-weight: 500; +} + +td { + border: 1px solid #ebebeb; + text-align: center; + font-weight: 300; +} + +form { + background: #f2f2f2; + padding: 20px; + +} + + +/* GENERAL ELEMENT TYPE STYLES */ + +h1 { + font-size: 2.8em; +} + +h2 { + font-size: 22px; + font-weight: bold; + color: #303030; + margin-bottom: 8px; +} + +h3 { + color: #d5000d; + font-size: 18px; + font-weight: bold; + margin-bottom: 8px; +} + +h4 { + font-size: 16px; + color: #303030; + font-weight: bold; +} + +h5 { + font-size: 1em; + color: #303030; +} + +h6 { + font-size: .8em; + color: #303030; +} + +p { + font-weight: 300; + margin-bottom: 20px; +} + +a { + text-decoration: none; +} + +p a { + font-weight: 400; +} + +blockquote { + font-size: 1.6em; + border-left: 10px solid #e9e9e9; + margin-bottom: 20px; + padding: 0 0 0 30px; +} + +ul li { + list-style: disc inside; + padding-left: 20px; +} + +ol li { + list-style: decimal inside; + padding-left: 3px; +} + +dl dd { + font-style: italic; + font-weight: 100; +} + +footer { + margin-top: 40px; + padding-top: 20px; + padding-bottom: 30px; + font-size: 13px; + color: #aaa; +} + +footer a { + color: #666; +} + +/* MISC */ +.clearfix:after { + clear: both; + content: '.'; + display: block; + visibility: hidden; + height: 0; +} + +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} \ No newline at end of file diff --git a/stylesheets/pygment_trac.css b/stylesheets/pygment_trac.css new file mode 100644 index 0000000..c6a6452 --- /dev/null +++ b/stylesheets/pygment_trac.css @@ -0,0 +1,69 @@ +.highlight { background: #ffffff; } +.highlight .c { color: #999988; font-style: italic } /* Comment */ +.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +.highlight .k { font-weight: bold } /* Keyword */ +.highlight .o { font-weight: bold } /* Operator */ +.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ +.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ +.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #aa0000 } /* Generic.Error */ +.highlight .gh { color: #999999 } /* Generic.Heading */ +.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ +.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #555555 } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */ +.highlight .gt { color: #aa0000 } /* Generic.Traceback */ +.highlight .kc { font-weight: bold } /* Keyword.Constant */ +.highlight .kd { font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ +.highlight .m { color: #009999 } /* Literal.Number */ +.highlight .s { color: #d14 } /* Literal.String */ +.highlight .na { color: #008080 } /* Name.Attribute */ +.highlight .nb { color: #0086B3 } /* Name.Builtin */ +.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ +.highlight .no { color: #008080 } /* Name.Constant */ +.highlight .ni { color: #800080 } /* Name.Entity */ +.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ +.highlight .nn { color: #555555 } /* Name.Namespace */ +.highlight .nt { color: #000080 } /* Name.Tag */ +.highlight .nv { color: #008080 } /* Name.Variable */ +.highlight .ow { font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #009999 } /* Literal.Number.Float */ +.highlight .mh { color: #009999 } /* Literal.Number.Hex */ +.highlight .mi { color: #009999 } /* Literal.Number.Integer */ +.highlight .mo { color: #009999 } /* Literal.Number.Oct */ +.highlight .sb { color: #d14 } /* Literal.String.Backtick */ +.highlight .sc { color: #d14 } /* Literal.String.Char */ +.highlight .sd { color: #d14 } /* Literal.String.Doc */ +.highlight .s2 { color: #d14 } /* Literal.String.Double */ +.highlight .se { color: #d14 } /* Literal.String.Escape */ +.highlight .sh { color: #d14 } /* Literal.String.Heredoc */ +.highlight .si { color: #d14 } /* Literal.String.Interpol */ +.highlight .sx { color: #d14 } /* Literal.String.Other */ +.highlight .sr { color: #009926 } /* Literal.String.Regex */ +.highlight .s1 { color: #d14 } /* Literal.String.Single */ +.highlight .ss { color: #990073 } /* Literal.String.Symbol */ +.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #008080 } /* Name.Variable.Class */ +.highlight .vg { color: #008080 } /* Name.Variable.Global */ +.highlight .vi { color: #008080 } /* Name.Variable.Instance */ +.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ + +.type-csharp .highlight .k { color: #0000FF } +.type-csharp .highlight .kt { color: #0000FF } +.type-csharp .highlight .nf { color: #000000; font-weight: normal } +.type-csharp .highlight .nc { color: #2B91AF } +.type-csharp .highlight .nn { color: #000000 } +.type-csharp .highlight .s { color: #A31515 } +.type-csharp .highlight .sc { color: #A31515 } diff --git a/stylesheets/stylesheet.css b/stylesheets/stylesheet.css new file mode 100644 index 0000000..7e3b8f0 --- /dev/null +++ b/stylesheets/stylesheet.css @@ -0,0 +1,479 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* LAYOUT STYLES */ +body { + font-size: 15px; + line-height: 1.5; + background: #fafafa url(../images/body-bg.jpg) 0 0 repeat; + font-family: 'Helvetica Neue', Helvetica, Arial, serif; + font-weight: 400; + color: #666; +} + +a { + color: #2879d0; +} +a:hover { + color: #2268b2; +} + +header { + padding-top: 40px; + padding-bottom: 40px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + background: #2e7bcf url(../images/header-bg.jpg) 0 0 repeat-x; + border-bottom: solid 1px #275da1; +} + +header h1 { + letter-spacing: -1px; + font-size: 72px; + color: #fff; + line-height: 1; + margin-bottom: 0.2em; + width: 540px; +} + +header h2 { + font-size: 26px; + color: #9ddcff; + font-weight: normal; + line-height: 1.3; + width: 540px; + letter-spacing: 0; +} + +.inner { + position: relative; + width: 940px; + margin: 0 auto; +} + +#content-wrapper { + border-top: solid 1px #fff; + padding-top: 30px; +} + +#main-content { + width: 690px; + float: left; +} + +#main-content img { + max-width: 100%; +} + +aside#sidebar { + width: 200px; + padding-left: 20px; + min-height: 504px; + float: right; + background: transparent url(../images/sidebar-bg.jpg) 0 0 no-repeat; + font-size: 12px; + line-height: 1.3; +} + +aside#sidebar p.repo-owner, +aside#sidebar p.repo-owner a { + font-weight: bold; +} + +#downloads { + margin-bottom: 40px; +} + +a.button { + width: 134px; + height: 58px; + line-height: 1.2; + font-size: 23px; + color: #fff; + padding-left: 68px; + padding-top: 22px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; +} +a.button small { + display: block; + font-size: 11px; +} +header a.button { + position: absolute; + right: 0; + top: 0; + background: transparent url(../images/github-button.png) 0 0 no-repeat; +} +aside a.button { + width: 138px; + padding-left: 64px; + display: block; + background: transparent url(../images/download-button.png) 0 0 no-repeat; + margin-bottom: 20px; + font-size: 21px; +} + +code, pre { + font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace; + color: #222; + margin-bottom: 30px; + font-size: 13px; +} + +code { + background-color: #f2f8fc; + border: solid 1px #dbe7f3; + padding: 0 3px; +} + +pre { + padding: 20px; + background: #fff; + text-shadow: none; + overflow: auto; + border: solid 1px #f2f2f2; +} +pre code { + color: #2879d0; + background-color: #fff; + border: none; + padding: 0; +} + +ul, ol, dl { + margin-bottom: 20px; +} + + +/* COMMON STYLES */ + +hr { + height: 1px; + line-height: 1px; + margin-top: 1em; + padding-bottom: 1em; + border: none; + background: transparent url('../images/hr.png') 0 0 no-repeat; +} + +table { + width: 100%; + border: 1px solid #ebebeb; +} + +th { + font-weight: 500; +} + +td { + border: 1px solid #ebebeb; + text-align: center; + font-weight: 300; +} + +form { + background: #f2f2f2; + padding: 20px; + +} + + +/* GENERAL ELEMENT TYPE STYLES */ + +#main-content h1 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 2.8em; + letter-spacing: -1px; + color: #474747; +} + +#main-content h1:before { + content: "/"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -0.9em; +} + +#main-content h2 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 22px; + font-weight: bold; + margin-bottom: 8px; + color: #474747; +} +#main-content h2:before { + content: "//"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -1.5em; +} + +#main-content h3 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 18px; + font-weight: bold; + margin-top: 24px; + margin-bottom: 8px; + color: #474747; +} + +#main-content h3:before { + content: "///"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -2em; +} + +#main-content h4 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 15px; + font-weight: bold; + color: #474747; +} + +h4:before { + content: "////"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -2.8em; +} + +#main-content h5 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 14px; + color: #474747; +} +h5:before { + content: "/////"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -3.2em; +} + +#main-content h6 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: .8em; + color: #474747; +} +h6:before { + content: "//////"; + color: #9ddcff; + padding-right: 0.3em; + margin-left: -3.7em; +} + +p { + margin-bottom: 20px; +} + +a { + text-decoration: none; +} + +p a { + font-weight: 400; +} + +blockquote { + font-size: 1.6em; + border-left: 10px solid #e9e9e9; + margin-bottom: 20px; + padding: 0 0 0 30px; +} + +ul li { + list-style: disc inside; + padding-left: 20px; +} + +ol li { + list-style: decimal inside; + padding-left: 3px; +} + +dl dd { + font-style: italic; + font-weight: 100; +} + +footer { + background: transparent url('../images/hr.png') 0 0 no-repeat; + margin-top: 40px; + padding-top: 20px; + padding-bottom: 30px; + font-size: 13px; + color: #aaa; +} + +footer a { + color: #666; +} +footer a:hover { + color: #444; +} + +/* MISC */ +.clearfix:after { + clear: both; + content: '.'; + display: block; + visibility: hidden; + height: 0; +} + +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} + +/* #Media Queries +================================================== */ + +/* Smaller than standard 960 (devices and browsers) */ +@media only screen and (max-width: 959px) {} + +/* Tablet Portrait size to standard 960 (devices and browsers) */ +@media only screen and (min-width: 768px) and (max-width: 959px) { + .inner { + width: 740px; + } + header h1, header h2 { + width: 340px; + } + header h1 { + font-size: 60px; + } + header h2 { + font-size: 30px; + } + #main-content { + width: 490px; + } + #main-content h1:before, + #main-content h2:before, + #main-content h3:before, + #main-content h4:before, + #main-content h5:before, + #main-content h6:before { + content: none; + padding-right: 0; + margin-left: 0; + } +} + +/* All Mobile Sizes (devices and browser) */ +@media only screen and (max-width: 767px) { + .inner { + width: 93%; + } + header { + padding: 20px 0; + } + header .inner { + position: relative; + } + header h1, header h2 { + width: 100%; + } + header h1 { + font-size: 48px; + } + header h2 { + font-size: 24px; + } + header a.button { + background-image: none; + width: auto; + height: auto; + display: inline-block; + margin-top: 15px; + padding: 5px 10px; + position: relative; + text-align: center; + font-size: 13px; + line-height: 1; + background-color: #9ddcff; + color: #2879d0; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + } + header a.button small { + font-size: 13px; + display: inline; + } + #main-content, + aside#sidebar { + float: none; + width: 100% ! important; + } + aside#sidebar { + background-image: none; + margin-top: 20px; + border-top: solid 1px #ddd; + padding: 20px 0; + min-height: 0; + } + aside#sidebar a.button { + display: none; + } + #main-content h1:before, + #main-content h2:before, + #main-content h3:before, + #main-content h4:before, + #main-content h5:before, + #main-content h6:before { + content: none; + padding-right: 0; + margin-left: 0; + } +} + +/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */ +@media only screen and (min-width: 480px) and (max-width: 767px) {} + +/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */ +@media only screen and (max-width: 479px) {} diff --git a/wercker.yml b/wercker.yml deleted file mode 100644 index 39a3f42..0000000 --- a/wercker.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This references a standard debian container from the -# Docker Hub https://registry.hub.docker.com/_/debian/ -# Read more about containers on our dev center -# http://devcenter.wercker.com/docs/containers/index.html -box: debian -# You can also use services such as databases. Read more on our dev center: -# http://devcenter.wercker.com/docs/services/index.html -# services: - # - postgres - # http://devcenter.wercker.com/docs/services/postgresql.html - - # - mongodb - # http://devcenter.wercker.com/docs/services/mongodb.html - -# This is the build pipeline. Pipelines are the core of wercker -# Read more about pipelines on our dev center -# http://devcenter.wercker.com/docs/pipelines/index.html -build: - # Steps make up the actions in your pipeline - # Read more about steps on our dev center: - # http://devcenter.wercker.com/docs/steps/index.html - steps: - - script: - name: echo - code: | - echo "hello world!" -