From 5ca07d34f524cf9b01cc9f58b7cecd04238ce93c Mon Sep 17 00:00:00 2001 From: mdb Date: Thu, 22 Mar 2001 02:45:13 +0000 Subject: [PATCH] Generate mp3 file names with leading zeros (ie. xx/ID/05.mp3) so that they are easier to deal with. git-svn-id: https://samskivert.googlecode.com/svn/trunk@110 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../robodj/src/java/robodj/importer/RipPanel.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/robodj/src/java/robodj/importer/RipPanel.java b/projects/robodj/src/java/robodj/importer/RipPanel.java index d6eb7340..f539a5db 100644 --- a/projects/robodj/src/java/robodj/importer/RipPanel.java +++ b/projects/robodj/src/java/robodj/importer/RipPanel.java @@ -1,5 +1,5 @@ // -// $Id: RipPanel.java,v 1.3 2001/03/21 00:41:03 mdb Exp $ +// $Id: RipPanel.java,v 1.4 2001/03/22 02:45:13 mdb Exp $ package robodj.importer; @@ -274,7 +274,7 @@ public class RipPanel int tno = i+1; // figure out the necessary paths - String npath = tpath.toString() + tno + ".mp3"; + String npath = tpath.toString() + pad(tno) + ".mp3"; String opath = createTempPath(tno, "mp3"); // move the file @@ -377,6 +377,15 @@ public class RipPanel } } + protected static String pad (int trackno) + { + if (trackno < 10) { + return "0" + trackno; + } else { + return Integer.toString(trackno); + } + } + protected ImporterFrame _frame; protected JButton _next; protected JButton _cancel;