diff options
Diffstat (limited to 'javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java')
-rw-r--r-- | javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java index 6fd91b8a0..727413bf2 100644 --- a/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java +++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java @@ -35,6 +35,7 @@ import androidx.annotation.NonNull; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.StaticIconName; +import com.smartdevicelink.util.DebugTool; import java.net.URI; import java.security.MessageDigest; @@ -44,7 +45,7 @@ import java.util.Arrays; /** * A class representing data to be uploaded to core */ -public class SdlFile { +public class SdlFile implements Cloneable { private String fileName; private String filePath; private URI uri; @@ -366,4 +367,22 @@ public class SdlFile { // return comparison return hashCode() == o.hashCode(); } + + /** + * Creates a deep copy of the object + * + * @return deep copy of the object, null if an exception occurred + */ + @Override + public SdlFile clone() { + try { + SdlFile fileClone = (SdlFile) super.clone(); + return fileClone; + } catch (CloneNotSupportedException e) { + if (DebugTool.isDebugEnabled()) { + throw new RuntimeException("Clone not supported by super class"); + } + } + return null; + } } |