39 | * As specified in {@link Throwable}, the message in the given cause
is not used in this instance's
40 | * message.
41 | *
55 | * The message is set to cause==null ? null : cause.toString()
, which by default contains the class
56 | * and message of cause
. This constructor is useful for call sites that just wrap another throwable.
57 | *
35 | * This method uses {@link Arrays#sort(Object[], Comparator)} 36 | * and returns the original array. 37 | * 38 | * @param files The files to sort, may be null 39 | * @return The sorted array 40 | * @since 2.0 41 | */ 42 | public File[] sort(final File... files) { 43 | if (files != null) { 44 | Arrays.sort(files, this); 45 | } 46 | return files; 47 | } 48 | 49 | /** 50 | * Sort a List of files. 51 | *
52 | * This method uses {@link Collections#sort(List, Comparator)}
53 | * and returns the original list.
54 | *
55 | * @param files The files to sort, may be null
56 | * @return The sorted list
57 | * @since 2.0
58 | */
59 | public List
25 | * Note that a subclass must override one of the accept methods,
26 | * otherwise your class will infinitely loop.
27 | *
28 | * @since 1.0
29 | * @version $Id$
30 | */
31 | public abstract class AbstractFileFilter implements IOFileFilter {
32 |
33 | /**
34 | * Checks to see if the File should be accepted by this filter.
35 | *
36 | * @param file the File to check
37 | * @return true if this file matches the test
38 | */
39 | @Override
40 | public boolean accept(final File file) {
41 | return accept(file.getParentFile(), file.getName());
42 | }
43 |
44 | /**
45 | * Checks to see if the File should be accepted by this filter.
46 | *
47 | * @param dir the directory File to check
48 | * @param name the filename within the directory to check
49 | * @return true if this file matches the test
50 | */
51 | @Override
52 | public boolean accept(final File dir, final String name) {
53 | return accept(new File(dir, name));
54 | }
55 |
56 | /**
57 | * Provide a String representation of this file filter.
58 | *
59 | * @return a String representation
60 | */
61 | @Override
62 | public String toString() {
63 | return getClass().getSimpleName();
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/ConditionalFileFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * Defines operations for conditional file filters.
23 | *
24 | * @since 1.1
25 | * @version $Id$
26 | */
27 | public interface ConditionalFileFilter {
28 |
29 | /**
30 | * Adds the specified file filter to the list of file filters at the end of
31 | * the list.
32 | *
33 | * @param ioFileFilter the filter to be added
34 | * @since 1.1
35 | */
36 | void addFileFilter(IOFileFilter ioFileFilter);
37 |
38 | /**
39 | * Returns this conditional file filter's list of file filters.
40 | *
41 | * @return the file filter list
42 | * @since 1.1
43 | */
44 | List
25 | * For example, here is how to print out a list of the
26 | * current directory's subdirectories:
27 | *
28 | *
25 | * For example, here is how to print out a list of the real files
26 | * within the current directory:
27 | *
28 | *
35 | * Defined in {@link FileFilter}.
36 | *
37 | * @param file the File to check
38 | * @return true if this file matches the test
39 | */
40 | @Override
41 | boolean accept(File file);
42 |
43 | /**
44 | * Checks to see if the File should be accepted by this filter.
45 | *
46 | * Defined in {@link FilenameFilter}.
47 | *
48 | * @param dir the directory File to check
49 | * @param name the filename within the directory to check
50 | * @return true if this file matches the test
51 | */
52 | @Override
53 | boolean accept(File dir, String name);
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/TrueFileFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter;
18 |
19 | import java.io.File;
20 | import java.io.Serializable;
21 |
22 | /**
23 | * A file filter that always returns true.
24 | *
25 | * @since 1.0
26 | * @version $Id$
27 | * @see FileFilterUtils#trueFileFilter()
28 | */
29 | public class TrueFileFilter implements IOFileFilter, Serializable {
30 |
31 | private static final long serialVersionUID = 8782512160909720199L;
32 | /**
33 | * Singleton instance of true filter.
34 | * @since 1.3
35 | */
36 | public static final IOFileFilter TRUE = new TrueFileFilter();
37 | /**
38 | * Singleton instance of true filter.
39 | * Please use the identical TrueFileFilter.TRUE constant.
40 | * The new name is more JDK 1.5 friendly as it doesn't clash with other
41 | * values when using static imports.
42 | */
43 | public static final IOFileFilter INSTANCE = TRUE;
44 |
45 | /**
46 | * Restrictive constructor.
47 | */
48 | protected TrueFileFilter() {
49 | }
50 |
51 | /**
52 | * Returns true.
53 | *
54 | * @param file the file to check (ignored)
55 | * @return true
56 | */
57 | @Override
58 | public boolean accept(final File file) {
59 | return true;
60 | }
61 |
62 | /**
63 | * Returns true.
64 | *
65 | * @param dir the directory to check (ignored)
66 | * @param name the filename (ignored)
67 | * @return true
68 | */
69 | @Override
70 | public boolean accept(final File dir, final String name) {
71 | return true;
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/CloseShieldInputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.input;
18 |
19 | import java.io.InputStream;
20 |
21 | /**
22 | * Proxy stream that prevents the underlying input stream from being closed.
23 | *
24 | * This class is typically used in cases where an input stream needs to be
25 | * passed to a component that wants to explicitly close the stream even if
26 | * more input would still be available to other components.
27 | *
28 | * @since 1.4
29 | */
30 | public class CloseShieldInputStream extends ProxyInputStream {
31 |
32 | /**
33 | * Creates a proxy that shields the given input stream from being
34 | * closed.
35 | *
36 | * @param in underlying input stream
37 | */
38 | public CloseShieldInputStream(final InputStream in) {
39 | super(in);
40 | }
41 |
42 | /**
43 | * Replaces the underlying input stream with a {@link ClosedInputStream}
44 | * sentinel. The original input stream will remain open, but this proxy
45 | * will appear closed.
46 | */
47 | @Override
48 | public void close() {
49 | in = new ClosedInputStream();
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/ClosedInputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.input;
18 |
19 | import static com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.IOUtils.EOF;
20 |
21 | import java.io.InputStream;
22 |
23 | /**
24 | * Closed input stream. This stream returns EOF to all attempts to read
25 | * something from the stream.
26 | *
27 | * Typically uses of this class include testing for corner cases in methods
28 | * that accept input streams and acting as a sentinel value instead of a
29 | * {@code null} input stream.
30 | *
31 | * @since 1.4
32 | */
33 | public class ClosedInputStream extends InputStream {
34 |
35 | /**
36 | * A singleton.
37 | */
38 | public static final ClosedInputStream CLOSED_INPUT_STREAM = new ClosedInputStream();
39 |
40 | /**
41 | * Returns -1 to indicate that the stream is closed.
42 | *
43 | * @return always -1
44 | */
45 | @Override
46 | public int read() {
47 | return EOF;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/InfiniteCircularInputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.input;
18 |
19 | import java.io.InputStream;
20 |
21 | /**
22 | *
23 | * An {@link InputStream} that infinitely repeats provided bytes.
24 | *
25 | * Closing a InfiniteCircularInputStream has no effect. The methods in
26 | * this class can be called after the stream has been closed without generating
27 | * an IOException.
28 | *
29 | */
30 | public class InfiniteCircularInputStream extends InputStream {
31 |
32 | final private byte[] repeatedContent;
33 | private int position = -1;
34 |
35 | /**
36 | * Creates a InfiniteCircularStream from the specified array of chars.
37 | *
38 | * @param repeatedContent
39 | * Input buffer to be repeated (not copied)
40 | */
41 | public InfiniteCircularInputStream(final byte[] repeatedContent) {
42 | this.repeatedContent = repeatedContent;
43 | }
44 |
45 | @Override
46 | public int read() {
47 | position = (position + 1) % repeatedContent.length;
48 | return repeatedContent[position] & 0xff; // copied from
49 | // java.io.ByteArrayInputStream.read()
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/TailerListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.input;
18 |
19 | /**
20 | * Listener for events from a {@link Tailer}.
21 | *
22 | * @since 2.0
23 | */
24 | public interface TailerListener {
25 |
26 | /**
27 | * The tailer will call this method during construction,
28 | * giving the listener a method of stopping the tailer.
29 | * @param tailer the tailer.
30 | */
31 | void init(Tailer tailer);
32 |
33 | /**
34 | * This method is called if the tailed file is not found.
35 | *
36 | * Note: this is called from the tailer thread.
37 | */
38 | void fileNotFound();
39 |
40 | /**
41 | * Called if a file rotation is detected.
42 | *
43 | * This method is called before the file is reopened, and fileNotFound may
44 | * be called if the new file has not yet been created.
45 | *
46 | * Note: this is called from the tailer thread.
47 | */
48 | void fileRotated();
49 |
50 | /**
51 | * Handles a line from a Tailer.
52 | *
53 | * Note: this is called from the tailer thread.
54 | * @param line the line.
55 | */
56 | void handle(String line);
57 |
58 | /**
59 | * Handles an Exception .
60 | *
61 | * Note: this is called from the tailer thread.
62 | * @param ex the exception.
63 | */
64 | void handle(Exception ex);
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/TailerListenerAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.input;
18 |
19 | /**
20 | * {@link TailerListener} Adapter.
21 | *
22 | * @since 2.0
23 | */
24 | public class TailerListenerAdapter implements TailerListener {
25 |
26 | /**
27 | * The tailer will call this method during construction,
28 | * giving the listener a method of stopping the tailer.
29 | * @param tailer the tailer.
30 | */
31 | @Override
32 | public void init(final Tailer tailer) {
33 | }
34 |
35 | /**
36 | * This method is called if the tailed file is not found.
37 | */
38 | @Override
39 | public void fileNotFound() {
40 | }
41 |
42 | /**
43 | * Called if a file rotation is detected.
44 | *
45 | * This method is called before the file is reopened, and fileNotFound may
46 | * be called if the new file has not yet been created.
47 | */
48 | @Override
49 | public void fileRotated() {
50 | }
51 |
52 | /**
53 | * Handles a line from a Tailer.
54 | * @param line the line.
55 | */
56 | @Override
57 | public void handle(final String line) {
58 | }
59 |
60 | /**
61 | * Handles an Exception .
62 | * @param ex the exception.
63 | */
64 | @Override
65 | public void handle(final Exception ex) {
66 | }
67 |
68 | /**
69 | * Called each time the Tailer reaches the end of the file.
70 | *
71 | * Note: this is called from the tailer thread.
72 | *
73 | * Note: a future version of commons-io will pull this method up to the TailerListener interface,
74 | * for now clients must subclass this class to use this feature.
75 | *
76 | * @since 2.5
77 | */
78 | public void endOfFileReached() {
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/input/package.html:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
21 | This package provides implementations of input classes, such as
22 |
21 | This package provides a component for monitoring file system events
22 | (directory and file create, update and delete events).
23 |
26 | * For example, can be used with any {@link java.io.Writer} or a {@link StringBuilder}
27 | * or {@link StringBuffer}.
28 | *
29 | * @since 2.5
30 | * @see Appendable
31 | * @version $Id$
32 | */
33 | public class AppendableOutputStream
24 | * This class is typically used in cases where an output stream needs to be
25 | * passed to a component that wants to explicitly close the stream even if
26 | * other components would still use the stream for output.
27 | *
26 | * Typically uses of this class include testing for corner cases in methods
27 | * that accept an output stream and acting as a sentinel value instead of
28 | * a {@code null} output stream.
29 | *
30 | * @since 1.4
31 | */
32 | public class ClosedOutputStream extends OutputStream {
33 |
34 | /**
35 | * A singleton.
36 | */
37 | public static final ClosedOutputStream CLOSED_OUTPUT_STREAM = new ClosedOutputStream();
38 |
39 | /**
40 | * Throws an {@link IOException} to indicate that the stream is closed.
41 | *
42 | * @param b ignored
43 | * @throws IOException always thrown
44 | */
45 | @Override
46 | public void write(final int b) throws IOException {
47 | throw new IOException("write(" + b + ") failed: stream is closed");
48 | }
49 |
50 | /**
51 | * Throws an {@link IOException} to indicate that the stream is closed.
52 | *
53 | * @throws IOException always thrown
54 | */
55 | @Override
56 | public void flush() throws IOException {
57 | throw new IOException("flush() failed: stream is closed");
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/output/NullOutputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.output;
18 |
19 | import java.io.IOException;
20 | import java.io.OutputStream;
21 |
22 | /**
23 | * This OutputStream writes all data to the famous /dev/null.
24 | *
25 | * This output stream has no destination (file/socket etc.) and all
26 | * bytes written to it are ignored and lost.
27 | *
21 | This package provides implementations of output classes, such as
22 |
21 | The commons-io component contains utility classes,
22 | filters, streams, readers and writers.
23 |
25 | These classes aim to add to the standard JDK IO classes.
26 | The utilities provide convenience wrappers around the JDK, simplifying
27 | various operations into pre-tested units of code.
28 | The filters and streams provide useful implementations that perhaps should
29 | be in the JDK itself.
30 |
21 | This package defines utility classes for working with streams, readers,
22 | writers and files. The most commonly used classes are described here:
23 |
25 | IOUtils is the most frequently used class.
26 | It provides operations to read, write, copy and close streams.
27 |
29 | FileUtils provides operations based around the JDK File class.
30 | These include reading, writing, copying, comparing and deleting.
31 |
33 | FilenameUtils provides utilities based on filenames.
34 | This utility class manipulates filenames without using File objects.
35 | It aims to simplify the transition between Windows and Unix.
36 | Before using this class however, you should consider whether you should
37 | be using File objects.
38 |
40 | FileSystemUtils allows access to the filing system in ways the JDK
41 | does not support. At present this allows you to get the free space on a drive.
42 |
44 | EndianUtils swaps data between Big-Endian and Little-Endian formats.
45 |
29 | * This object is immutable and thread-safe.
30 | *
26 | * This object is immutable and thread-safe.
27 | *
27 | * This object is immutable and thread-safe.
28 | *
21 | This package provides a framework for controlling the deserialization of classes.
22 | These classes are not thread-safe. Contains the concept of an exception with context i.e. such an exception
21 | will contain a map with keys and values. This provides an easy way to pass valuable
22 | state information at exception time in useful form to a calling process. Lastly, {@link org.apache.commons.lang3.exception.ExceptionUtils}
24 | also contains
23 | *
25 | * A typical use case would be to enable a primitive or string to be passed to a method and allow that method to
26 | * effectively change the value of the primitive/string. Another use case is to store a frequently changing primitive in
27 | * a collection (for example a total in a map) without needing to create new Integer/Long wrapper objects.
28 | *
29 | * @since 2.1
30 | * @param These classes are not thread-safe.
20 | This document is the API specification for the Apache Commons Lang library.
21 | Most of these classes are immutable and thus thread-safe.
23 | However Charset is not currently guaranteed thread-safe under all circumstances. These classes are immutable, and therefore thread-safe.File
s that are directories.
24 | *
29 | * File dir = new File(".");
30 | * String[] files = dir.list( DirectoryFileFilter.INSTANCE );
31 | * for ( int i = 0; i < files.length; i++ ) {
32 | * System.out.println(files[i]);
33 | * }
34 | *
35 | *
36 | * @since 1.0
37 | * @version $Id$
38 | *
39 | * @see FileFilterUtils#directoryFileFilter()
40 | */
41 | public class DirectoryFileFilter extends AbstractFileFilter implements Serializable {
42 |
43 | private static final long serialVersionUID = -5148237843784525732L;
44 | /**
45 | * Singleton instance of directory filter.
46 | * @since 1.3
47 | */
48 | public static final IOFileFilter DIRECTORY = new DirectoryFileFilter();
49 | /**
50 | * Singleton instance of directory filter.
51 | * Please use the identical DirectoryFileFilter.DIRECTORY constant.
52 | * The new name is more JDK 1.5 friendly as it doesn't clash with other
53 | * values when using static imports.
54 | */
55 | public static final IOFileFilter INSTANCE = DIRECTORY;
56 |
57 | /**
58 | * Restrictive constructor.
59 | */
60 | protected DirectoryFileFilter() {
61 | }
62 |
63 | /**
64 | * Checks to see if the file is a directory.
65 | *
66 | * @param file the File to check
67 | * @return true if the file is a directory
68 | */
69 | @Override
70 | public boolean accept(final File file) {
71 | return file.isDirectory();
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/FalseFileFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter;
18 |
19 | import java.io.File;
20 | import java.io.Serializable;
21 |
22 | /**
23 | * A file filter that always returns false.
24 | *
25 | * @since 1.0
26 | * @version $Id$
27 | *
28 | * @see FileFilterUtils#falseFileFilter()
29 | */
30 | public class FalseFileFilter implements IOFileFilter, Serializable {
31 |
32 | private static final long serialVersionUID = 6210271677940926200L;
33 | /**
34 | * Singleton instance of false filter.
35 | * @since 1.3
36 | */
37 | public static final IOFileFilter FALSE = new FalseFileFilter();
38 | /**
39 | * Singleton instance of false filter.
40 | * Please use the identical FalseFileFilter.FALSE constant.
41 | * The new name is more JDK 1.5 friendly as it doesn't clash with other
42 | * values when using static imports.
43 | */
44 | public static final IOFileFilter INSTANCE = FALSE;
45 |
46 | /**
47 | * Restrictive constructor.
48 | */
49 | protected FalseFileFilter() {
50 | }
51 |
52 | /**
53 | * Returns false.
54 | *
55 | * @param file the file to check (ignored)
56 | * @return false
57 | */
58 | @Override
59 | public boolean accept(final File file) {
60 | return false;
61 | }
62 |
63 | /**
64 | * Returns false.
65 | *
66 | * @param dir the directory to check (ignored)
67 | * @param name the filename (ignored)
68 | * @return false
69 | */
70 | @Override
71 | public boolean accept(final File dir, final String name) {
72 | return false;
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/FileFileFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter;
18 |
19 | import java.io.File;
20 | import java.io.Serializable;
21 |
22 | /**
23 | * This filter accepts File
s that are files (not directories).
24 | *
29 | * File dir = new File(".");
30 | * String[] files = dir.list( FileFileFilter.FILE );
31 | * for ( int i = 0; i < files.length; i++ ) {
32 | * System.out.println(files[i]);
33 | * }
34 | *
35 | *
36 | * @since 1.3
37 | * @version $Id$
38 | * @see FileFilterUtils#fileFileFilter()
39 | */
40 | public class FileFileFilter extends AbstractFileFilter implements Serializable {
41 |
42 | private static final long serialVersionUID = 5345244090827540862L;
43 | /** Singleton instance of file filter */
44 | public static final IOFileFilter FILE = new FileFileFilter();
45 |
46 | /**
47 | * Restrictive constructor.
48 | */
49 | protected FileFileFilter() {
50 | }
51 |
52 | /**
53 | * Checks to see if the file is a file.
54 | *
55 | * @param file the File to check
56 | * @return true if the file is a file
57 | */
58 | @Override
59 | public boolean accept(final File file) {
60 | return file.isFile();
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/filefilter/IOFileFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.filefilter;
18 |
19 | import java.io.File;
20 | import java.io.FileFilter;
21 | import java.io.FilenameFilter;
22 |
23 | /**
24 | * An interface which brings the FileFilter and FilenameFilter
25 | * interfaces together.
26 | *
27 | * @since 1.0
28 | * @version $Id$
29 | */
30 | public interface IOFileFilter extends FileFilter, FilenameFilter {
31 |
32 | /**
33 | * Checks to see if the File should be accepted by this filter.
34 | * InputStream
and Reader
.
23 | /dev/null
.
39 | * @param b The bytes to write
40 | * @param off The start offset
41 | * @param len The number of bytes to write
42 | */
43 | @Override
44 | public void write(final byte[] b, final int off, final int len) {
45 | //to /dev/null
46 | }
47 |
48 | /**
49 | * Does nothing - output to /dev/null
.
50 | * @param b The byte to write
51 | */
52 | @Override
53 | public void write(final int b) {
54 | //to /dev/null
55 | }
56 |
57 | /**
58 | * Does nothing - output to /dev/null
.
59 | * @param b The bytes to write
60 | * @throws IOException never
61 | */
62 | @Override
63 | public void write(final byte[] b) throws IOException {
64 | //to /dev/null
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/output/package.html:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | OutputStream
and Writer
.
23 | true
if the supplied class name matches this object's condition.
28 | *
29 | * @param className fully qualified class name
30 | * @return true
if the class name matches this object's condition
31 | */
32 | boolean matches(String className);
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/serialization/FullClassNameMatcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.serialization;
20 |
21 | import java.util.Arrays;
22 | import java.util.Collections;
23 | import java.util.HashSet;
24 | import java.util.Set;
25 |
26 | /**
27 | * A {@link ClassNameMatcher} that matches on full class names.
28 | * pattern
is null
47 | */
48 | public RegexpClassNameMatcher(final Pattern pattern) {
49 | if (pattern == null) {
50 | throw new IllegalArgumentException("Null pattern");
51 | }
52 | this.pattern = pattern;
53 | }
54 |
55 | @Override
56 | public boolean matches(final String className) {
57 | return pattern.matcher(className).matches();
58 | }
59 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/softsec/mobsec/dae/apimonitor/hook/apis/httphook/virjarSocketHook/orgApacheCommons/io/serialization/WildcardClassNameMatcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.serialization;
20 |
21 | import com.softsec.mobsec.dae.apimonitor.hook.apis.httphook.virjarSocketHook.orgApacheCommons.io.FilenameUtils;
22 |
23 | /**
24 | * A {@link ClassNameMatcher} that uses simplified regular expressions
25 | * provided by {@link org.apache.commons.io.FilenameUtils#wildcardMatch(String, String) FilenameUtils.wildcardMatch}
26 | * equals(Object)
, toString()
,
20 | hashCode()
, and compareTo(Object)
methods.
21 | @see java.lang.Object#equals(Object)
22 | @see java.lang.Object#toString()
23 | @see java.lang.Object#hashCode()
24 | @see java.lang.Comparable#compareTo(Object)
25 | @since 1.0
26 | Throwable
manipulation and examination routines.Mutable
is used as a generic interface to the implementations in this package.
24 | * java.lang.reflect
APIs.
26 | @since 3.0
27 |