22622
|
1 |
<!DOCTYPE html>
|
|
2 |
|
|
3 |
<html>
|
|
4 |
<head>
|
|
5 |
<title>Try-with-Resources Feature Demo</title>
|
|
6 |
</head>
|
|
7 |
<body>
|
|
8 |
<h2>Try-with-Resources Feature Demo</h2>
|
|
9 |
|
|
10 |
<p>
|
|
11 |
This demo shows how to use the try-with-resources feature introduced in JDK7.
|
|
12 |
</p>
|
|
13 |
|
|
14 |
<ul>
|
|
15 |
<li><h3>Custom AutoCloseable.</h3>
|
|
16 |
|
|
17 |
<p>
|
|
18 |
Shows how to use a custom resource with the try-with-resources construct.
|
|
19 |
For more information, see the source file.
|
|
20 |
</p>
|
|
21 |
Source: <a href="src/CustomAutoCloseableSample.java">src/CustomAutoCloseableSample.java</a>
|
|
22 |
|
|
23 |
<li><h3>Unzip</h3>
|
|
24 |
|
|
25 |
<p>
|
|
26 |
Extracts archived files. For more information, see the source file.
|
|
27 |
</p>
|
|
28 |
Source: <a href="src/Unzip.java">src/Unzip.java</a>
|
|
29 |
<li><h3>ZipCat</h3>
|
|
30 |
|
|
31 |
<p>Prints data about a specified file from an archive. For more information, see the source file.</p>
|
|
32 |
Source: <a href="src/ZipCat.java">src/ZipCat.java</a>
|
|
33 |
|
|
34 |
</ul>
|
|
35 |
</body>
|
|
36 |
</html> |