applesingle/api
2018-06-03 15:42:07 -05:00
..
src Adding Filter and altering AppleSingle write mechanism to be more 2018-06-03 15:42:07 -05:00
build.gradle Gradle tweaks: fix for Oracle javadoc doclint strictness; made the signing task a bit more intelligent. 2018-05-29 10:46:19 -05:00
MAVEN-REPO.md Adding information for pushing to Maven Central as well as using the api. 2018-05-26 18:07:56 -05:00
README.md Fixing Maven coordinates. 2018-05-26 21:11:38 -05:00

Java API Examples

Usage is catered to the factory methods and builder. Some sample are included below.

Maven / Gradle

To include in a Maven project:

<dependency>
    <groupId>net.sf.applecommander</groupId>
    <artifactId>applesingle-api</artifactId>
    <version>1.0.0</version>
</dependency>

To include in a Gradle project:

dependencies {
    // ...
    compile "net.sf.applecommander:applesingle-api:1.0.0"
    // ...
}

Read AppleSingle

Use the factory method to...

Reading from standard input:

AppleSingle as = AppleSingle.read(System.in);

Reading from a file:

File file = new File("myfile.as");
AppleSingle as = AppleSingle.read(file);

The AppleSingle file can be read from an InputStream, File, Path, or just a byte array.

Create AppleSingle

Use the builder to create a new AppleSingle file and then save it...

AppleSingle as = AppleSingle.builder()
        .dataFork(dataFork)
        .realName(realName)
        .build();
        
Path file = Paths.get("mynewfile.as"); 
as.save(file);

The save(...) method can save to a File, Path, or an OutputStream.