Rider Testimonial

I used eclipse 10 years and moved to IntelliJ in 2017 since then no turning back, a true Java IDE, perfect refactoring also any editing capabilities, and in 2024 I moved to Redgate Monitor and C# after 18 years of Java I was scared but thanks to JetBrains Rider, when I open the Rider it asked me what shortcut set do I choose, and there was IntelliJ option, I chose it and jumped into the code and adoption time was incredible, in days I understand how is the structure (over 180 projects under multiple solution and thousands of classes/files) and started contributing the project. ...

July 31, 2024 · 2 min · Özkan Pakdil

Add Jetbrains Fleet to right click context menu in windows 11

Jetbrains fleet is a new editor, it is kind of vscode competitor, and little bit faster then other IDEA and VScode so I wanted to ahve it in the context menu. @echo off setlocal enabledelayedexpansion :: Set the path to your Fleet executable using %USERPROFILE% set "FLEET_PATH=%USERPROFILE%\AppData\Local\Programs\Fleet\Fleet.exe" :: Check if running with admin privileges net session >nul 2>&1 if %errorLevel% neq 0 ( echo This script requires administrator privileges. echo Please run it as an administrator. pause exit /b 1 ) :: Add Fleet to context menu reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Fleet" /ve /d "Open with Fleet" /f reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Fleet\command" /ve /d "\"%FLEET_PATH%\" \"%%V\"" /f reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Fleet" /v "Icon" /d "%FLEET_PATH%" /f echo Fleet has been added to the context menu. echo Please restart File Explorer or your PC for changes to take effect. pause looks like below ...

July 15, 2024 · 1 min · Özkan Pakdil

Creating Installers for Java Applications with jpackage

Jpackage, a powerful tool introduced in Java 14. In this blog post, I’ll explore how to use jpackage to create installers for different operating systems, with a focus on creating an MSI installer for Windows. What is jpackage? jpackage is a packaging tool that comes bundled with the Java Development Kit (JDK) since version 14. It allows developers to package Java applications into platform-specific packages that can be easily distributed and installed. It contains the JRE in the generated package and one trigger executable for specified platform. jpackage supports creating various types of installers, including: ...

June 29, 2024 · 2 min · Özkan Pakdil

Spring boot 3 RestClient and RestTemplate logging http requests and response

In Spring boot(SB) 2 the configuration was different, now in SB3 we need to configure the rest client differently. Before SB3 there was RestTemplate now there is new Rest api coming in spring world. Find more details here. Adding the required dependency which will do the real http logging here. implementation 'org.apache.httpcomponents.client5:httpclient5:5.3.1' The big difference is properties configuration, it is changed and not documented on spring site logging.level.org.apache.hc.client5.http.wire=DEBUG logging.level.org.apache.hc.client5.http=DEBUG Using only “wire” will give request/response dump. And that extra http=DEBUG will give connection and more debug log, find it at the end of the page. ...

May 18, 2024 · 8 min · Özkan Pakdil

How to use resources(file and memory) in try

I wrote a small piece of code to do some pdf encryption with openpdf, and intellij`s sonarlint was complaining about “Resources should be closed” more details here non compliant public class PasswordProtectedPDF { private static final Logger logger = Logger.getLogger(PasswordProtectedPDF.class.getName()); static final String USER_PASSWORD = "111"; static final String OWNER_PASSWORD = "111"; public static void main(String[] args) { try { File f = new File("1_protected.pdf"); FileOutputStream out = new FileOutputStream(f); File pdfFile = new File("1.pdf"); PdfReader reader = new PdfReader(pdfFile.getPath()); PdfStamper stamper = new PdfStamper(reader, out); HashMap<String, String> info = new HashMap<>(); info.put("Producer", ""); reader.getInfo().forEach((key, value) -> { logger.info("Key: " + key + ", Value: " + value); }); stamper.setInfoDictionary(info); stamper.setEncryption(USER_PASSWORD.getBytes(), OWNER_PASSWORD.getBytes(), PdfWriter.ALLOW_PRINTING, PdfWriter.ENCRYPTION_AES_128); stamper.close(); logger.info("Password protected PDF created successfully."); } catch (IOException e) { logger.severe("Error creating password protected PDF: " + e.getMessage()); } } } Compliant public class PasswordProtectedPDF { private static final Logger logger = Logger.getLogger(PasswordProtectedPDF.class.getName()); static final String USER_PASSWORD = "111"; static final String OWNER_PASSWORD = "111"; public static void main(String[] args) { try ( FileOutputStream out = new FileOutputStream(new File("1_protected.pdf")); PdfReader reader = new PdfReader(new File("1.pdf").getPath()) ) { PdfStamper stamper = new PdfStamper(reader, out); HashMap<String, String> info = new HashMap<>(); info.put("Producer", ""); reader.getInfo().forEach((key, value) -> { logger.info("Key: " + key + ", Value: " + value); }); stamper.setInfoDictionary(info); stamper.setEncryption(USER_PASSWORD.getBytes(), OWNER_PASSWORD.getBytes(), PdfWriter.ALLOW_PRINTING, PdfWriter.ENCRYPTION_AES_128); stamper.close(); logger.info("Password protected PDF created successfully."); } catch (IOException e) { logger.severe("Error creating password protected PDF: " + e.getMessage()); } } } just a reminder we can define multiple resources in try block ...

April 18, 2024 · 2 min · Özkan Pakdil