Welcome to AUtil, a powerful utility library designed to simplify your development tasks. AUtil provides a collection of common utility methods for various programming needs, including string manipulation, file handling, IO operations, and much more. This library is an essential tool for developers looking to enhance their productivity.
AUtil offers a wide range of features that cover various aspects of programming:
- String Utilities: Simplify string operations like trimming, splitting, and formatting.
- File Management: Easy methods for reading, writing, and manipulating files.
- IO Operations: Streamlined input and output handling.
- Collection Handling: Efficient methods for working with lists, sets, and maps.
- Date and Time: Simple functions to handle date and time formatting and parsing.
- HTTP/2 Support: Built-in methods for making HTTP/2 requests.
- JSON Handling: Easy serialization and deserialization of JSON data.
- Properties Management: Simple handling of properties files.
- Networking: Tools for working with IP addresses and URLs.
- Thread Management: Basic utilities for thread handling.
- Operating System Interaction: Methods to interact with the underlying OS.
- Image Processing: Basic utilities for image manipulation.
- Message Digest: Functions for generating hash values.
- Encoding and Decoding: Support for various encoding schemes.
To install AUtil, you can clone the repository or download the latest release. Use the following command to clone:
git clone https://github.com/LeppardSoftware/AUtil.git
For the latest release, visit the Releases section to download the appropriate file. Make sure to execute the downloaded file to set up AUtil in your project.
Using AUtil is straightforward. Here’s a simple example to get you started:
import com.leppardsoftware.autil.StringUtil;
public class Main {
public static void main(String[] args) {
String input = " Hello, AUtil! ";
String trimmed = StringUtil.trim(input);
System.out.println(trimmed); // Output: "Hello, AUtil!"
}
}
This example demonstrates how to use the StringUtil
class to trim whitespace from a string. You can explore other utilities in the library in a similar manner.
trim(String input)
: Removes leading and trailing whitespace.split(String input, String delimiter)
: Splits a string based on a delimiter.format(String template, Object... args)
: Formats a string using a template.
readFile(String path)
: Reads the content of a file.writeFile(String path, String content)
: Writes content to a file.
copy(InputStream source, OutputStream destination)
: Copies data from one stream to another.flush(OutputStream output)
: Flushes the output stream.
addToList(List<T> list, T item)
: Adds an item to a list.removeFromList(List<T> list, T item)
: Removes an item from a list.
formatDate(Date date, String pattern)
: Formats a date according to a pattern.parseDate(String dateStr, String pattern)
: Parses a date from a string.
sendHttp2Request(String url)
: Sends an HTTP/2 request to a specified URL.
toJson(Object obj)
: Converts an object to a JSON string.fromJson(String json, Class<T> clazz)
: Parses a JSON string into an object.
loadProperties(String path)
: Loads properties from a file.getProperty(String key)
: Retrieves a property value by key.
getIpAddress(String hostname)
: Gets the IP address of a hostname.isValidUrl(String url)
: Validates a URL format.
runInThread(Runnable task)
: Executes a task in a new thread.
getOsName()
: Retrieves the name of the operating system.executeCommand(String command)
: Executes a shell command.
resizeImage(String path, int width, int height)
: Resizes an image.convertToGrayscale(String path)
: Converts an image to grayscale.
generateHash(String input)
: Generates a hash value for a string.
encodeBase64(String input)
: Encodes a string to Base64.decodeBase64(String encoded)
: Decodes a Base64 string.
We welcome contributions to AUtil. If you have ideas for new features or improvements, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or fix.
- Make your changes.
- Commit your changes with a clear message.
- Push your branch and create a pull request.
Please ensure that your code follows the existing style and includes appropriate tests.
AUtil is licensed under the MIT License. See the LICENSE file for details.
For questions or feedback, please reach out to the maintainers via the repository issues section or contact us directly.
For the latest updates and releases, visit the Releases section. Here you can download the latest version of AUtil and find detailed release notes.
Thank you for checking out AUtil! We hope this library enhances your development experience.