Package jmri.jmrix.can.cbus.node
Class CbusNodeBackupFile
- java.lang.Object
-
- jmri.jmrit.XmlFile
-
- jmri.jmrix.can.cbus.node.CbusNodeBackupFile
-
public class CbusNodeBackupFile extends XmlFile
Class to define location for a CbusNodeBackup File.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrit.XmlFile
XmlFile.Validate
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CanSystemConnectionMemo
memo
protected java.lang.String
oldFileLocation
-
Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation
-
-
Constructor Summary
Constructors Constructor Description CbusNodeBackupFile(CanSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
deleteFile(int nodeNum)
Delete Backup File for a given Node Number.java.lang.String
getDefaultFileName(int nodeNum)
Get Backup FileName for a given Node Number.java.io.File
getFile(int nodeNum, boolean store)
Get Backup File for a given Node Number.java.lang.String
getFileLocation()
Path to location of files.java.lang.String
getFileName(int nodeNum)
Get Backup FileName for a given Node Number.-
Methods inherited from class jmri.jmrit.XmlFile
addDefaultInfo, backupFileName, checkFile, createFileNameWithDate, dumpElement, findFile, getBuilder, getDefaultDtdLocation, getDefaultValidate, getDtdLocation, getProcessingInstructionHRef, getProcessingInstructionType, getRoot, getValidate, makeBackupFile, makeBackupFile, newDocument, newDocument, revertBackupFile, rootFromFile, rootFromInputStream, rootFromName, rootFromURL, setDefaultDtdLocation, setDefaultValidate, setDtdLocation, setValidate, userFileChooser, userFileChooser, writeXML, xmlDir
-
-
-
-
Field Detail
-
memo
final CanSystemConnectionMemo memo
-
oldFileLocation
protected final java.lang.String oldFileLocation
-
-
Constructor Detail
-
CbusNodeBackupFile
public CbusNodeBackupFile(CanSystemConnectionMemo memo)
-
-
Method Detail
-
getDefaultFileName
@Nonnull public java.lang.String getDefaultFileName(int nodeNum)
Get Backup FileName for a given Node Number. Includes full directory path and filename.- Parameters:
nodeNum
- Node Number- Returns:
- the Backup File location within user directory.
-
getFile
@CheckForNull public java.io.File getFile(int nodeNum, boolean store)
Get Backup File for a given Node Number.- Parameters:
nodeNum
- Node Numberstore
- True to make a new file if does not exist- Returns:
- the Backup File
-
getFileName
public java.lang.String getFileName(int nodeNum)
Get Backup FileName for a given Node Number.- Parameters:
nodeNum
- Node Number- Returns:
- the Backup FileName
-
getFileLocation
public java.lang.String getFileLocation()
Path to location of files.- Returns:
- path to location
-
deleteFile
public boolean deleteFile(int nodeNum)
Delete Backup File for a given Node Number.- Parameters:
nodeNum
- Node Number- Returns:
- true if no file to delete, or delete success. Else false.
-
-