file - Java API for considering multiple physical drives as a single logical drive(clustered storage) -
we need store files in particular directory on windows machine(say c:/datalocation). due huge number of files, c drive gets filled eventually. need location in drive, let d:/anotherstore.
initially can use following code access store location.
file store = new file("c:/datalocation"); but later when add drive, there way consider new location logical part of first location?
something below code.
store.addanotherlocation("c:/anotherstore"); here store should able retrieve data both locations.
there no java api, can catch "not enough disk space" exception ioexception , handle making code save files in other location. , while retrieving files, in both locations if requested file exists.
ok, if want randomly save in 2 locations, save file in both locations based on (int)(math.random()*2); . if 0 , save in c:/datalocation else in d:/otherstore
Comments
Post a Comment