Permalink
Browse files

refactored author and packageinterface

  • Loading branch information...
1 parent 5a4146c commit a57ec4a8e0347fa545df03e8e1c9d62b479d6214 @pulse00 committed Sep 9, 2012
View
@@ -1,32 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/main/java/"/>
+ <classpathentry kind="src" path="src/main/resources/"/>
+ <classpathentry kind="src" path="src/test/java/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
@@ -1,5 +1,8 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
@@ -1,9 +1,17 @@
package org.getcomposer.core;
public class Author {
-
+
public String name;
public String email;
public String homepage;
+ public Author(String name) {
+ this.name = name;
+ }
+
+ public String getInitString() {
+ return String.format("%s <%s>", name, email);
+ }
+
}
@@ -34,6 +34,7 @@
public String homepage;
public String url;
public String fullPath;
+ public String minimumStability;
public Map<String, String> require;
public Map<String, String> requireDev;
public Autoload autoload;
@@ -272,4 +273,8 @@ public License getLicense() {
public Author[] getAuthors() {
return authors;
}
+
+ public String getMinimumStability() {
+ return minimumStability;
+ }
}
@@ -32,6 +32,8 @@
public abstract String getHomepage();
public abstract String getUrl();
+
+ public abstract String getMinimumStability();
public abstract String getFullPath();
@@ -11,31 +11,22 @@
import java.io.InputStream;
import java.io.InputStreamReader;
-import org.getcomposer.core.ComposerConstants;
import org.getcomposer.core.PHPPackage;
import com.google.gson.Gson;
import com.google.gson.stream.JsonReader;
public class PackageDownloader extends Downloader {
- private String packageName;
-
+
public PackageDownloader(String packageName) {
- super(ComposerConstants.packageURL);
-
- // TODO: validate packageName
- this.packageName = packageName;
+ super(packageName);
}
public PHPPackage getPackage() throws IOException {
if (!url.endsWith(".json")) {
url += ".json";
}
- url = String.format(ComposerConstants.packageURL, packageName);
-
- System.err.println("Downloading from url " + url);
-
InputStream resource = downloadResource();
InputStreamReader reader = new InputStreamReader(resource);
JsonReader jsonReader = new JsonReader(reader);

0 comments on commit a57ec4a

Please sign in to comment.