ProscCore
ProscCore is a dependency-free Java utility library used across all 360Works projects (MirrorSync, Scribe, etc.).
It requires no third-party libraries — only the JDK itself. It is organized into the following packages:
Package Summary
{@link com.prosc.core} — Core exceptions and math utilities
- ExceptionCoreUtils — Static helpers for extracting root causes, formatting stack traces, and locating specific exception types in a cause chain.
- FeedbackException — RuntimeException subclass carrying a user-displayable feedback message (distinct from the technical message).
- WrapperException — RuntimeException that wraps checked exceptions; use to propagate checked exceptions through interfaces that don't declare them.
- NoSuchItemException — Thrown when a requested item does not exist in a collection or data source.
- MathUtils — Numeric utilities: safe integer parsing, clamping, and rounding helpers.
{@link com.prosc.data} — Collections, converters, and data structures
- BasicTypeConverter — Converts strings and objects to/from Java primitives and common types (Boolean, Integer, Date, etc.). Central conversion utility.
- Credentials — Immutable username/password pair. Lightweight alternative to passing separate String params.
- MultiMap — Map that associates multiple values per key (Map<K, List<V>> wrapper with convenience methods).
- ValueHolder — Mutable single-value container; useful for capturing values inside lambdas or anonymous classes.
- AggregatorLong — Accumulates a running sum of long values; thread-safe counter alternative.
- ChunkedSpliterator — Spliterator that groups elements into fixed-size chunks for batch processing with streams.
- FlatMappingSpliterator — Spliterator that flat-maps each element to a stream, enabling flatMap-style stream pipelines.
- ListIteratorAdaptor — Adapts an Iterator to a ListIterator (forward-only; useful when APIs require ListIterator).
{@link com.prosc.data.tuple} — Typed tuples
- Pair — Immutable 2-element typed tuple.
- Triplet — Immutable 3-element typed tuple.
- Quadruple — Immutable 4-element typed tuple.
{@link com.prosc.exception} — General-purpose exceptions
- NestedException — RuntimeException that wraps another throwable with a descriptive message; similar to WrapperException but always takes a message.
- CanceledException — Thrown when an operation is explicitly canceled by the user or system (not an error condition).
{@link com.prosc.format} — Formatters and parsers
- FlexibleDateFormat — Parses many date string formats (ISO, US, European, etc.) into java.util.Date. Useful when input format is not guaranteed.
- FlexibleTimeFormat — Parses flexible time strings (12h/24h, with/without seconds, AM/PM) into java.util.Date.
- UTCTimestampFormat — Formats/parses timestamps in UTC ISO-8601 format for storage and serialization.
- RelativeDateFormat — Formats timestamps as human-readable relative strings ("2 hours ago", "yesterday").
- DateRangeFormatter — Formats a start/end date pair as a compact human-readable range string.
- DurationFormat — Formats millisecond durations as "Xh Ym Zs" strings.
- SecondsDurationFormatter — Formats a duration given in seconds as hours/minutes/seconds text.
- ByteLengthFormat — Formats byte counts as human-readable sizes ("1.4 MB", "512 KB").
- GlobalCurrencyFormat — Formats numeric values as currency strings using the system locale.
- NumberTextFormatter — Converts numbers to English text ("forty-two").
- ObfuscateFormat — Masks sensitive values for display (e.g., shows "****" for passwords).
- PhoneFormatter — Formats and normalizes US phone numbers.
- UrlFormat — Formats values as URL-encoded strings.
- WikiFormat / Wikifier — Wiki-style text markup formatter; converts wiki syntax to HTML.
- WordWrapFormatter — Wraps long text at a specified column width.
{@link com.prosc.function} — Functional interfaces with checked-exception support
- FunctionThrowable — Like {@link java.util.function.Function} but declares a checked exception; for use in streams via LambdaExceptionUtil.
- FunctionThrowable1 — Single-argument variant of FunctionThrowable.
- SupplierThrowable — Like {@link java.util.function.Supplier} but declares a checked exception.
- Scorer — Function interface that assigns a numeric score to an object; used with ScoringSortFilter.
- ScoringSortFilter — Sorts and optionally filters a list based on numeric scores returned by a Scorer.
{@link com.prosc.infrastructure} — JVM introspection and assertion utilities
- Platform — Detects the current OS (Windows/Mac/Linux), JVM bitness, and other environment properties.
- ClassUtils — Classpath and class-loading utilities: finding resources, listing classes in a package.
- AssertUtils — Assertion helpers that throw descriptive IllegalStateException/IllegalArgumentException instead of AssertionError.
- LogUtils — Logging setup helpers; configures java.util.logging handlers and formatters.
- StringLogHandler — java.util.logging Handler that captures log output into a String (useful for tests).
{@link com.prosc.io} — I/O, HTTP, ZIP, and process utilities
- IOUtils — Core I/O utility methods: stream copying, reading streams to strings/bytes, closing quietly, temp files.
- HttpClientUtils — Makes HTTP GET/POST requests using the built-in Java HTTP client; handles redirects and character encoding.
- HttpServer — Lightweight embedded HTTP server built on com.sun.net.httpserver; easy single-class setup for internal/test services.
- HttpIOException — IOException subclass that carries an HTTP status code; thrown when an HTTP request returns a non-2xx response.
- HttpStatusCodes — Constants for common HTTP status codes (200, 404, 500, etc.).
- AwsUrlEncoder — URL encoder that follows AWS Signature v4 encoding rules (stricter than standard URL encoding).
- ZipCreator — Creates ZIP archives from files or directories.
- ZipExtractor — Extracts ZIP archives to a target directory.
- DirectoryUtils — Directory operations: recursive copy, delete, listing, temp directory creation.
- RecursiveDirectoryScanner — Walks a directory tree and yields files matching an optional filter.
- CustomNameFilter — FilenameFilter backed by a set of allowed names or glob patterns.
- FileType / FileTypes — MIME-type-to-extension mappings; determines content type from file extension.
- ProcessUtils — Runs external OS processes, captures stdout/stderr, and checks exit codes.
- ProcessExecutionException — Thrown when an OS process exits with a non-zero status.
- StreamReaderThread — Background thread that drains an InputStream to a String or Writer (prevents blocked processes).
- StreamWriterThread — Background thread that writes data to an OutputStream asynchronously.
- LogOutputStream — OutputStream that redirects all writes to a java.util.logging Logger.
- ByteBufferInputStream — InputStream backed by a ByteBuffer; avoids copying for in-memory data.
- InterruptibleInputStream / InterruptibleOutputStream — Stream wrappers that respect thread interruption during blocking I/O.
- ProgressLogInputStream — InputStream wrapper that logs progress (bytes read) at configurable intervals.
- CRLFConvertingReader — Reader that normalizes CR, LF, and CRLF line endings to LF on the fly.
- DelimitedReader — Reads a stream token-by-token using a configurable delimiter string.
- TokenScanner / TokenScanningInputStream — Scan a stream for delimiter tokens, returning the content between them.
- SimpleXMLWriter — Lightweight streaming XML writer; no external XML library required.
- Hostname — Resolves and caches the local machine hostname.
- FullScanNeededException — Signals that an incremental operation cannot proceed and a full data scan is required.
{@link com.prosc.lang} — Java language utilities
- LambdaExceptionUtil — Wraps checked-exception-throwing lambdas so they can be used with standard functional interfaces (Function, Consumer, Supplier, etc.). Rethrows checked exceptions as unchecked.
{@link com.prosc.logging} — Logging configuration
- LoggingConfig — Configures java.util.logging for the application; sets formatters, log levels, and handlers from properties or defaults.
{@link com.prosc.model} — Model-layer exceptions
- InvalidDataException — Thrown when data fails validation at the model layer; carries a field name and human-readable message.
{@link com.prosc.net} — Network utilities
- IpAddressUtils — Parses, validates, and compares IP addresses; checks whether an address is in a given subnet.
- LocalhostLookup — Reliably resolves the loopback/localhost address even in unusual network configurations.
{@link com.prosc.scheduler} — Task scheduling
- ScheduledRunnable — Runnable with a configurable repeat interval; wraps a task for use with ScheduledExecutorService.
{@link com.prosc.security} — Encryption and authentication
- EncryptionUtils — AES and RSA encryption/decryption helpers using only JDK classes. Also provides password hashing (SHA-256) and Base64 encode/decode.
- InvalidPasswordException — Thrown when a supplied password does not meet requirements or is incorrect.
- LoginFailedException — Thrown when authentication fails (bad credentials, locked account, etc.).
{@link com.prosc.shared} — General-purpose utilities (the largest package)
- StringUtils — Comprehensive string utilities: trimming, splitting, joining, contains-ignore-case, padding, truncation, CSV parsing, and more.
- NumberUtils — Safe numeric parsing (parseInt/parseLong/parseDouble that return defaults instead of throwing), range checks.
- CollectionUtils — Collection helpers: null-safe iteration, list slicing, converting arrays to lists, set operations.
- ArgsParser — Parses command-line-style argument strings (key=value pairs and flags) into a typed map.
- Arg — Descriptor for a single expected argument; used with ArgsParser to define and validate arguments.
- ArgParsingException — Thrown by ArgsParser when input cannot be parsed.
- Retry — Executes a Callable with configurable retry logic (max attempts, delay, exception filter).
- CallableWithRetry — Callable wrapper that retries on failure; lower-level than Retry.
- RetryException — Thrown when all retry attempts are exhausted.
- ReflectionUtils — Reflection helpers: getting/setting fields by name, finding methods, instantiating classes dynamically.
- ReflectionFieldException — Thrown when a reflective field access fails.
- CaseInsensitiveMap — Map<String, V> that treats keys as case-insensitive.
- IdentityHashSet — Set backed by IdentityHashMap (equality by reference, not equals()).
- ListGrouper — Groups a sorted list into sublists by a key function; useful for reports and batch processing.
- ListGroupIdentifier — Key extractor interface used by ListGrouper.
- DefaultComparator — Null-safe Comparator that falls back to natural ordering.
- StringParser — Parses structured string patterns (similar to scanf); extracts typed values from a formatted string.
- DebugTimer — Simple elapsed-time timer for development/debug logging; logs duration on close().
- PerformanceInfo — Captures and summarizes execution timing stats (min/max/avg over multiple samples).
- TaskThrowable — Carries a Throwable from a background task back to the calling thread.
- Bool — Mutable boolean holder; use to mutate a boolean inside a lambda.
- NoSuchException — Generic "item not found" exception with a descriptive message.
{@link com.prosc.text} — Text parsing
- QuotedTextTokenizer — Tokenizes strings that may contain quoted substrings (handles escaped quotes and delimiters inside quotes).
- TabularDataParser — Parses tab-delimited or CSV tabular data into rows and named columns.
{@link com.prosc.thread} — Threading utilities
- ThreadUtil — Static helpers: sleeping without checked exceptions, creating named daemon threads, querying thread state.
- CustomThread — Thread subclass with built-in exception logging and an optional name prefix.
- MyThreadFactory — ThreadFactory that creates named, optionally daemon threads; use with ExecutorService.
- TimeoutTask — Runs a task with a hard timeout; throws TimeoutException if the task exceeds the allotted time.
- FutureUtil — Helpers for working with CompletableFuture: unwrapping ExecutionException, composing with timeouts.
- LazyCompletableFuture — CompletableFuture that defers computation until first accessed.
- StartThreads — Starts multiple threads and optionally waits for all to finish.
- CallableWrapper — Wraps a Runnable as a Callable<Void>.
- QueueCounter — Thread-safe counter with await-until-zero support; useful for tracking in-flight work items.
- ThreadListener — Callback interface notified when a thread starts, finishes, or throws an exception.
{@link com.prosc.util} — Miscellaneous utilities
- UrlUtil — URL encode/decode, query-string building and parsing, relative-to-absolute URL resolution.
- Debounce — Delays execution of an action until calls stop arriving for a specified quiet period (debounce pattern).
{@link com.prosc.windows} — Windows-specific utilities
- WindowsRegistry — Reads and writes Windows registry keys via a JNI-free approach (spawns reg.exe). Only functional on Windows.
- WindowsUtils — Miscellaneous Windows helpers: shortcut creation, UAC elevation check.
- NoSuchRegistryEntryException — Thrown when a requested Windows registry key or value does not exist.
- WindowsRegistryAccessException — Thrown when a Windows registry access fails due to permissions or other OS errors.