Java tutorial
//package com.java2s; public class Main { public static String formatFileName(String type, long recordId, long size, String ext) { String c = "-"; String dot = "."; return type + c + recordId + c + Integer.valueOf(String.valueOf(size), 16) + dot + ext; } }