// inode{1}/inode{2}/inode.file_extension
java.io.File workingIOFile = fileAPI.getAssetIOFile(actualFile);
//http://jira.dotmarketing.net/browse/DOTCMS-1873
//To clear velocity cache
DotResourceCache vc = CacheLocator.getVeloctyResourceCache();
vc.remove(ResourceManager.RESOURCE_TEMPLATE + workingIOFile.getPath());
// If a new version was created, we move the current
// data to the new version
if (file != null && InodeUtils.isSet(file.getInode())) {
byte[] currentData = new byte[0];
FileInputStream is = new FileInputStream(workingIOFile);
int size = is.available();
currentData = new byte[size];
is.read(currentData);
java.io.File newVersionFile = fileAPI.getAssetIOFile(file);
//http://jira.dotmarketing.net/browse/DOTCMS-1873
//To clear velocity cache
vc.remove(ResourceManager.RESOURCE_TEMPLATE + newVersionFile.getPath());
FileChannel channelTo = new FileOutputStream(newVersionFile).getChannel();
ByteBuffer currentDataBuffer = ByteBuffer.allocate(currentData.length);
currentDataBuffer.put(currentData);
currentDataBuffer.position(0);