Skip to content

Commit

Permalink
Added an example to README
Browse files Browse the repository at this point in the history
  • Loading branch information
toomasr committed Apr 24, 2019
1 parent cbfc0f8 commit abb4dc4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ and these non-functional requirements:

## Examples

The examples don't include all the possible ways how to use the library but will give an overview. When you see a method that is useful but doesn't necessarily solve your use case then just head over to [ZipUtil.class](https://github.com/zeroturnaround/zt-zip/blob/master/src/main/java/org/zeroturnaround/zip/ZipUtil.java) file and see the sibling methods that are named the same but arguments might be different.

### Unpacking

#### Check if an entry exists in a ZIP archive
Expand Down Expand Up @@ -165,6 +167,10 @@ ZipUtil.pack(new File("/tmp/demo"), new File("/tmp/demo.zip"), new NameMapper()
}
});
```
#### Compress a file into a ZIP archive
```java
ZipUtil.packEntry(new File("/tmp/demo.txt"), new File("/tmp/demo.zip"));
```

#### Add an entry from file to a ZIP archive
```java
Expand Down

0 comments on commit abb4dc4

Please sign in to comment.