Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Maven version #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
target/
*.iml
Binary file removed SitarHero/Engine$1.class
Binary file not shown.
Binary file removed SitarHero/Files.class
Binary file not shown.
4 changes: 0 additions & 4 deletions SitarHero/Files.ctxt

This file was deleted.

11 changes: 0 additions & 11 deletions SitarHero/Files.java

This file was deleted.

Binary file removed SitarHero/Game$1.class
Binary file not shown.
Binary file removed SitarHero/Game$2.class
Binary file not shown.
Binary file removed SitarHero/Game.class
Binary file not shown.
22 changes: 0 additions & 22 deletions SitarHero/Game.ctxt

This file was deleted.

Binary file removed SitarHero/Note$1.class
Binary file not shown.
Binary file removed SitarHero/Note$2.class
Binary file not shown.
Binary file removed SitarHero/Note.class
Binary file not shown.
26 changes: 0 additions & 26 deletions SitarHero/Note.ctxt

This file was deleted.

File renamed without changes.
Binary file removed SitarHero/ReactRect$1.class
Binary file not shown.
Binary file removed SitarHero/ReactionRectangle$1.class
Binary file not shown.
Binary file removed SitarHero/ReactionRectangle.class
Binary file not shown.
10 changes: 0 additions & 10 deletions SitarHero/ReactionRectangle.ctxt

This file was deleted.

Binary file removed SitarHero/Sitar$1.class
Binary file not shown.
Binary file removed SitarHero/Sitar.class
Binary file not shown.
8 changes: 0 additions & 8 deletions SitarHero/Sitar.ctxt

This file was deleted.

Binary file removed SitarHero/SitarHero$1.class
Binary file not shown.
Binary file removed SitarHero/SitarHero.class
Binary file not shown.
16 changes: 0 additions & 16 deletions SitarHero/SitarHero.ctxt

This file was deleted.

Binary file removed SitarHero/Song$1.class
Binary file not shown.
Binary file removed SitarHero/Song.class
Binary file not shown.
22 changes: 0 additions & 22 deletions SitarHero/Song.ctxt

This file was deleted.

2 changes: 0 additions & 2 deletions SitarHero/manifest

This file was deleted.

134 changes: 0 additions & 134 deletions SitarHero/package.bluej

This file was deleted.

44 changes: 44 additions & 0 deletions SitarHero/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.game</groupId>
<artifactId>sitarhero</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<includes>
<include>**/*</include>
</includes>
<archive>
<manifest>
<mainClass>SitarHero</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>


</project>
42 changes: 42 additions & 0 deletions SitarHero/src/main/java/Files.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import java.io.*;
import java.net.URL;
import java.nio.file.Paths;

public class Files {

public static File getFile(String path) {
try {
URL resource = Files.class.getResource(path);
return Paths.get(resource.toURI()).toFile();
} catch (Exception e) {
System.out.println(e.getMessage());
}
return null;
}

public static InputStream getInputStream(String path) {
try {
return Files.class.getResourceAsStream(path);
} catch (Exception e) {
System.out.println(e.getMessage());
}
return null;
}

public static byte[] toByteArray(InputStream in) throws IOException {

ByteArrayOutputStream os = new ByteArrayOutputStream();

byte[] buffer = new byte[1024];
int len;

// read bytes from the input stream and store them in buffer
while ((len = in.read(buffer)) != -1) {
// write bytes from the buffer into output stream
os.write(buffer, 0, len);
}

return os.toByteArray();
}

}
Loading