jaulib v1.3.0
Jau Support Library (C++, Java, ..)
JaulibJarSHASum.java
Go to the documentation of this file.
1/**
2 * Author: Sven Gothel <sgothel@jausoft.com>
3 * Copyright (c) 2020 Gothel Software e.K.
4 * Copyright (c) 2010 Gothel Software e.K.
5 * Copyright (c) 2010 JogAmp Community
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26package org.jau.pkg;
27
28import java.io.IOException;
29import java.net.URISyntaxException;
30import java.security.MessageDigest;
31import java.security.NoSuchAlgorithmException;
32import java.util.ArrayList;
33import java.util.List;
34import java.util.regex.Pattern;
35
36import org.jau.base.JaulibVersion;
37import org.jau.sec.SHASum;
38
39/**
40 * jaulib definition of {@link TempJarSHASum}'s specialization of {@link SHASum}.
41 * <p>
42 * Implementation uses {@link org.jau.pkg.cache.TempJarCache}.
43 * </p>
44 * <p>
45 * Constructor defines the includes and excludes as used for jaulib {@link SHASum} computation.
46 * </p>
47 */
48public class JaulibJarSHASum extends TempJarSHASum {
49 /**
50 * See {@link JaulibJarSHASum}
51 * @throws SecurityException
52 * @throws IllegalArgumentException
53 * @throws NoSuchAlgorithmException
54 * @throws IOException
55 * @throws URISyntaxException
56 */
58 throws SecurityException, IllegalArgumentException, NoSuchAlgorithmException, IOException, URISyntaxException
59 {
60 super(MessageDigest.getInstance("SHA-256"), JaulibVersion.class, new ArrayList<Pattern>(), new ArrayList<Pattern>());
61 final List<Pattern> excludes = getExcludes();
62 final List<Pattern> includes = getIncludes();
63 final String origin = getOrigin();
64 excludes.add(Pattern.compile(origin+"/jau/sys/android"));
65 includes.add(Pattern.compile(origin+"/org/jau/.*"));
66 includes.add(Pattern.compile(origin+"/jau/.*"));
67 }
68}
jaulib definition of TempJarSHASum's specialization of SHASum.
JaulibJarSHASum()
See JaulibJarSHASum.
SHASum specialization utilizing TempJarCache to access jar file content for SHA computation
final List< Pattern > getIncludes()
Definition: SHASum.java:204
final List< Pattern > getExcludes()
Definition: SHASum.java:203