Placy is a high-performance, enterprise-grade file transformation service that processes placeholders in files and archives with lightning speed. Designed to handle massive files (100MB+) efficiently while supporting an extensive range of file formats including archives, documents, images, and text files.
- ๐ฆ Archives: JAR, WAR, EAR, ZIP, TAR, 7Z, GZIP, BZIP2, XZ and many more
- ๐ Documents: Word (.docx, .doc), Excel (.xlsx, .xls), PowerPoint (.pptx), PDF
- ๐ผ๏ธ Images: JPEG, PNG, TIFF, GIF with metadata editing support
- ๐ Text Files: All programming languages, configuration files, markup languages
- โ Java Bytecode: Class file transformation using ASM
- โก Instant Response: Advanced caching for near-instant processing of repeated operations
- ๐๏ธ Large File Optimization: Streaming architecture handles 100MB+ files without memory issues
- ๐ Parallel Processing: Automatic parallel processing for files >10MB
- ๐ง Memory Efficient: Processes files in chunks to minimize memory footprint
- ๐ง Smart Buffering: Dynamic buffer sizing based on file size
- โก Asynchronous Processing: Optional concurrent file processing for maximum throughput
- ๐ API Key Authentication: Optional SECRET_KEY validation
- ๐ก๏ธ HTTPS Support: TLS 1.3/1.2 with modern cipher suites
- ๐ช Secure Sessions: HTTP-only, secure, same-site cookies
- ๐ Health Monitoring: Built-in actuator endpoints
JAR, WAR, EAR, AAR, ZIP, APK, XPI, CRUX, VSIX, NUPKG
TAR, TAR.GZ, TAR.BZ2, TAR.XZ, 7Z, GZIP, BZIP2, XZ
Word: .docx, .doc
Excel: .xlsx, .xls
PowerPoint: .pptx
PDF: .pdf (content-only)
Text: .txt, .md, .json, .xml, .html, .css, .js, .properties, .yml, .yaml
JPEG, PNG, TIFF, GIF, BMP, ICO, SVG, WEBP, RAW formats
HEIC, HEIF, AVIF, and 50+ other formats
Java, JavaScript, TypeScript, Python, C/C++, C#, Go, Rust, Kotlin, Scala
HTML, CSS, XML, JSON, YAML, SQL, Shell scripts, and more
- Java 17 or higher
- 2GB RAM minimum (4GB recommended for large files)
-
Download the latest release
wget https://github.com/Harfull/placy/releases/latest/download/Placy.jar
-
Run the application
java -jar Placy.jar
-
Access the API
http://localhost:8080
# Server Configuration
export SERVER_PORT=8080
export HTTPS_ENABLED=false
# Security (Optional)
export SECRET_KEY=your-secret-key-here
# SSL Configuration (if HTTPS enabled)
export SSL_KEYSTORE_PATH=/path/to/keystore.p12
export SSL_KEYSTORE_PASSWORD=changeit
export SSL_KEY_ALIAS=placyPOST /api/v1/transform
curl -X POST http://localhost:8080/api/v1/transform \
-H "Content-Type: multipart/form-data" \
-H "X-Secret-Key: your-key" \
-F "file=@your-file.jar" \
-F 'placeholders={"${VERSION}":"1.2.3","${ENV}":"production"}'- Success: Returns the transformed file as binary data
- Error: JSON error response with details
X-Secret-Key: Required if SECRET_KEY environment variable is setContent-Type:multipart/form-data
๐ฆ Placy
โโโ ๐ฎ Controllers (REST API)
โโโ ๐ FileTypeDetector (Smart file type detection)
โโโ ๐ StreamProcessor (High-performance streaming)
โโโ ๐ฆ ArchiveProcessor (All archive formats)
โโโ ๐ผ๏ธ ImageProcessor (Metadata editing)
โโโ ๐ DocumentProcessor (Office documents)
โโโ โ ClassProcessor (Java bytecode)
- File Type Detection: Intelligent detection using extensions and content analysis
- Route to Processor: Files are routed to specialized processors
- Transformation: Placeholders replaced using optimized algorithms
- Caching: Results cached for instant repeat operations
- Response: Processed file returned to client
- API Key Protection: Optional SECRET_KEY validation for API access
- HTTPS/TLS Support: Full SSL/TLS support with modern security
- Input Validation: Comprehensive validation of all inputs
- Memory Protection: Streaming prevents memory exhaustion attacks
- Error Handling: Secure error responses without information leakage
Placy can process nested archives (e.g., JAR inside ZIP inside TAR.GZ) recursively.
- File Type Cache: Instant file type detection for known files
- Processing Cache: Cached results for identical file/placeholder combinations
- CRC32 Cache: Optimized archive integrity checking
Large files are automatically processed in parallel chunks for maximum performance.
- Streaming I/O: Files processed without loading entirely into memory
- Dynamic Buffers: Buffer sizes adapt to file size for optimal performance
- Garbage Collection: Efficient memory cleanup prevents memory leaks
git clone https://github.com/Harfull/placy.git
cd placy
### Asynchronous Processing
Placy supports high-performance asynchronous file processing for optimal throughput:
#### **Async Processing Mode** (`ASYNC_PROCESSING=true`)
- **Concurrent Processing**: Multiple files processed simultaneously using thread pools
- **Non-blocking Operations**: API calls return immediately with processing handled asynchronously
- **Intelligent Thread Management**: Dynamic thread pool sizing based on system capabilities
- **Graceful Degradation**: Falls back to synchronous processing if thread pool is saturated
- **Error Isolation**: Individual file errors don't affect other files in batch operations
#### **Synchronous Processing Mode** (Default)
- **Sequential Processing**: Files processed one at a time in order
- **Predictable Resource Usage**: Lower memory footprint and CPU usage
- **Simplified Error Handling**: Immediate error reporting without async complexity
#### **Performance Characteristics**
| Processing Mode | Single File | Multiple Files | Resource Usage | Throughput |
|----------------|-------------|----------------|----------------|------------|
| Synchronous | Standard | Sequential | Low | Moderate |
| Asynchronous | Standard | Concurrent | Higher | High |
#### **Thread Pool Configuration**
- **Core Pool Size**: `max(2, availableProcessors / 2)`
- **Max Pool Size**: `max(4, availableProcessors * 2)`
- **Queue Capacity**: 100 tasks
- **Keep Alive Time**: 60 seconds
- **Rejection Policy**: Graceful fallback to synchronous execution
./gradlew build./gradlew bootRun./gradlew test# Server Configuration
server.port=8080
server.servlet.context-path=/
# File Upload Limits
spring.servlet.multipart.max-file-size=50MB
spring.servlet.multipart.max-request-size=50MB
# SSL Configuration
server.ssl.enabled=false
server.ssl.key-store=classpath:keystore.p12
server.ssl.key-store-password=changeit- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Apache POI - Office document processing
- Apache Commons Compress - Archive format support
- ASM - Java bytecode manipulation
- Spring Boot - Application framework
- TwelveMonkeys ImageIO - Enhanced image format support
Built with โค๏ธ for developers who need fast, reliable file processing