mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-01 09:50:32 +00:00
use file name as volume name
This commit is contained in:
parent
43ff3c203e
commit
4ab834300d
@ -24,13 +24,14 @@ public class NuFX
|
||||
private int totalDisks;
|
||||
private int totalBlocks;
|
||||
|
||||
private VolumeName volumeName = new VolumeName ();
|
||||
private VolumeName volumeName;
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
public NuFX (Path path) throws FileFormatException, IOException
|
||||
// ---------------------------------------------------------------------------------//
|
||||
{
|
||||
buffer = Files.readAllBytes (path);
|
||||
volumeName = new VolumeName (path);
|
||||
|
||||
masterHeader = new MasterHeader (buffer);
|
||||
|
||||
@ -82,8 +83,6 @@ public class NuFX
|
||||
if (record.hasDisk ())
|
||||
++totalDisks;
|
||||
}
|
||||
|
||||
// volumeName.info ();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------//
|
||||
@ -211,6 +210,18 @@ public class NuFX
|
||||
private String volumeName = "DiskBrowser";
|
||||
private int nameOffset = 0;
|
||||
|
||||
// -------------------------------------------------------------------------------//
|
||||
VolumeName (Path path)
|
||||
// -------------------------------------------------------------------------------//
|
||||
{
|
||||
volumeName = path.getFileName ().toString ();
|
||||
int pos = volumeName.lastIndexOf ('.');
|
||||
if (pos > 0)
|
||||
volumeName = volumeName.substring (0, pos);
|
||||
if (volumeName.length () > 15)
|
||||
volumeName = volumeName.substring (0, 15);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------//
|
||||
private void storePath (String fileName)
|
||||
// -------------------------------------------------------------------------------//
|
||||
@ -240,6 +251,9 @@ public class NuFX
|
||||
private String getVolumeName ()
|
||||
// -------------------------------------------------------------------------------//
|
||||
{
|
||||
if (true)
|
||||
return volumeName;
|
||||
|
||||
if (rootContainsFiles)
|
||||
return volumeName;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user