// Used for creating the top drawer. public Drawer(String fullPath) { StorageRecord sr = new StorageRecord(true); this.isDrawer = true; this.name = sr.getTopDrawerName(); this.fullPath = fullPath; if (fullPath != null) { Directory.CreateDirectory(fullPath); } }
// Main constructor public Files(Drawer parent, String name) { StorageRecord sr = new StorageRecord(); this.isDrawer = false; this.name = name; this.fullPath = parent.getFullPath() + "\\" + name; this.parent = parent; if (this.fullPath != null && !File.Exists(fullPath)) { File.Create(fullPath).Close(); sr.getListOfItems().Add(this); } }
// Contrustor for when there is no parent. public Files(String name, String fullPath) { StorageRecord sr = new StorageRecord(); this.isDrawer = false; this.name = name; this.fullPath = fullPath; this.parent = sr.getTopDrawer(); if (this.fullPath != null && !File.Exists(fullPath)) { File.Create(fullPath).Close(); sr.getListOfItems().Add(this); } }
public Drawer(Drawer parent, String name) { StorageRecord sr = new StorageRecord(); this.isDrawer = true; this.name = name; this.parent = parent; this.fullPath = parent.getFullPath() + "\\" + name; if (fullPath != null && !Directory.Exists(fullPath)) { Directory.CreateDirectory(fullPath); sr.getListOfItems().Add(this); } }
public Drawer(String name, String fullPath) { StorageRecord sr = new StorageRecord(); this.isDrawer = true; this.parent = sr.getTopDrawer(); this.name = name; this.fullPath = fullPath; if (fullPath != null && !Directory.Exists(fullPath)) { Directory.CreateDirectory(fullPath); sr.getListOfItems().Add(this); } }