/// <summary> /// /// </summary> /// <param name="fileRequest"></param> /// <returns></returns> public DocsPaVO.documento.FileDocumento GetFile(DocsPaVO.documento.FileRequest fileRequest) { this.CheckForRepositoryExpired(); this.CheckForFileExist(fileRequest); return((DocsPaVO.documento.FileDocumento) SessionRepositorySerializerHelper.Deserialize(this.GetFilePath(fileRequest))); }
/// <summary> /// /// </summary> /// <param name="rootPath"> /// Path del repository /// </param> /// <param name="context"></param> private SessionRepositoryFileManager(DocsPaVO.documento.SessionRepositoryContext context) { this.Context = context; // Verifica che il repository di sessione non sia scaduto this.CheckForRepositoryExpired(); // Reperimento dell'owner persistito e confronto con l'owner corrente // per verificare utilizzi non autorizzati DocsPaVO.utente.InfoUtente owner = (DocsPaVO.utente.InfoUtente)SessionRepositorySerializerHelper.Deserialize(Path.Combine(GetContextRepositoryPath(this.Context), "owner.dat")); if (!owner.dst.Equals(this.Context.Owner.dst)) { throw new ApplicationException(string.Format("Utente {0} non autorizzato all'utilizzo del repository", this.Context.Owner.userId)); } }