if (host != null && InodeUtils.isSet(host.getInode())&& InodeUtils.isSet(folder.getInode())) {
Identifier identifier = APILocator.getIdentifierAPI().find(host,path);
File file = new File();
file.setTitle(fileName);
file.setFileName(fileName);
file.setShowOnMenu(false);
file.setModDate(new Date());
String mimeType = fileAPI.getMimeType(fileName);
file.setMimeType(mimeType);
String author = user.getFullName();
file.setAuthor(author);
file.setModUser(author);
file.setSortOrder(0);
file.setShowOnMenu(false);
if (identifier !=null && InodeUtils.isSet(identifier.getId()) && !identifier.getAssetType().equals("contentlet")) {
File actualFile = fileAPI.getFileByURI(path, host, false,user,false);
if(!UtilMethods.isSet(actualFile.getInode())){
actualFile = (File)APILocator.getVersionableAPI().findWorkingVersion(identifier, user, false);
WebAssetFactory.unArchiveAsset(actualFile);
}
if(!UtilMethods.isSet(actualFile.getInode())){
throw new DotDataException("unable to locate file");
}
// identifier = idapi.find(actualFile);
WebAssetFactory.createAsset(file, user.getUserId(), folder, identifier, false, false);
if(publish && perAPI.doesUserHavePermission(file, PermissionAPI.PERMISSION_PUBLISH, user)){