Namespace: OpenEdge.Web.DataObject
Type: Class FileOperationHandler
Parent Classes:
Inherits: Progress.Lang.Object
Implements: OpenEdge.Logging.ISupportLogging, OpenEdge.Web.DataObject.IOperationHandler


/* *************************************************************************************************************************
Copyright (c) 2016, 2018, 2021-2022 by Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
File:FileOperationHandler
Purpose:Delegate for mapped file operations for the DOH
Author(s):pjudge
Created:Fri May 20 12:15:00 EDT 2016
/* A reference to the Logger in use by an implementer



Method Summary
  Options Name Purpose
  CanRead (FileInfo) /* Ensures that we have read permissions for this file or folder @param FileInfo The file or folder */
  CanWrite (FileInfo) /* Ensures that we have write permissions for this file or folder @param FileInfo The file or folder */
  INTEGER Execute (IWebRequest, Object, IHttpResponse, DataObjectService, MappedOperation, Object) /* Executes the operation. @param IWebRequest The request that resulting in the exception @param P.L.Object The message body of the incoming request. Typically will be transformed from bytes into something useful; may also have an envelope removed. @param IHttpResponse The current response object, if any @param DataObjectService The service being operated on @param MappedOperation The mapped operation @param P.L.Object The business entity (business logic service) @return integer A non-null status code use to deal with errors */
  INTEGER Read (MappedOperation, IWebRequest, IHttpResponse) /* Reads a file off disk and puts it into the response Entity. If the operation is a HEAD request, then do not add the body. @param MappedOperation The current operation @param IWebRequest The source request @param IHttpResponse the response @return integer The status code to return */
  INTEGER Remove (MappedOperation, IWebRequest, IHttpResponse) /* Deletes a file from disk @param MappedOperation The current operation @param IWebRequest The source request @param IHttpResponse the response @return integer The status code to return */
  OpenEdge.Core.File ResolveTarget (MappedOperation, IWebRequest) /* Creates a File instance representing the operation's target Relative operation targets are made relative to the webapp's folder. @param MappedOperation The current operation. @param IWebRequest The request being serviced @return File A file instance representing the operation target path/file */
  CHARACTER ResolveTokens (MappedOperation, IWebRequest) /* Resolves any tokens in the file name (TargetName) into appropriate values @param MappedOperation The operation @param IWebRequest The current request @return character The resolved filename */
  ValidatePath (FileInfo, Folder) /* Ensures that the file or folder is in an appropriate location @param FileInfo the file or folder to validate @param Folder The tomcat webapp path */
  INTEGER Write (MappedOperation, IWebRequest, Object, IHttpResponse) /* Writes a file to disk from the request's Entity @param MappedOperation The current operation @param IWebRequest The source request @param IHttpResponse the response @return integer The status code to return */

Constructor Summary
  Options Name Purpose
  FileOperationHandler () /* Default constructor */

Property Summary
  Options Name Purpose
  OpenEdge.Logging.ILogWriter Logger


Method Detail
Top

CanRead (FileInfo)

/* Ensures that we have read permissions for this file or folder
Parameters:
pPath OpenEdge.Core.FileInfo
 
Top

CanWrite (FileInfo)

/* Ensures that we have write permissions for this file or folder
Parameters:
pPath OpenEdge.Core.FileInfo
 
Top

INTEGER Execute (IWebRequest, Object, IHttpResponse, DataObjectService, MappedOperation, Object)

/* Executes the operation.
will be transformed from bytes into something useful; may also have an envelope removed.
Parameters:
poRequest OpenEdge.Web.IWebRequest
 
poMessageBody Progress.Lang.Object
 
poResponse OpenEdge.Net.HTTP.IHttpResponse
 
pService OpenEdge.Web.DataObject.DataObjectService
 
poOperation OpenEdge.Web.DataObject.MappedOperation
 
poBusinessEntity Progress.Lang.Object
 
Returns INTEGER
  integer A non-null status code use to deal with errors
Top

INTEGER Read (MappedOperation, IWebRequest, IHttpResponse)

/* Reads a file off disk and puts it into the response Entity.
If the operation is a HEAD request, then do not add the body.
Parameters:
poOperation OpenEdge.Web.DataObject.MappedOperation
 
poRequest OpenEdge.Web.IWebRequest
 
poResponse OpenEdge.Net.HTTP.IHttpResponse
 
Returns INTEGER
  integer The status code to return
Top

INTEGER Remove (MappedOperation, IWebRequest, IHttpResponse)

/* Deletes a file from disk
Parameters:
poOperation OpenEdge.Web.DataObject.MappedOperation
 
poRequest OpenEdge.Web.IWebRequest
 
poResponse OpenEdge.Net.HTTP.IHttpResponse
 
Returns INTEGER
  integer The status code to return
Top

OpenEdge.Core.File ResolveTarget (MappedOperation, IWebRequest)

/* Creates a File instance representing the operation's target
Relative operation targets are made relative to the webapp's folder.
Parameters:
pOperation OpenEdge.Web.DataObject.MappedOperation
 
pRequest OpenEdge.Web.IWebRequest
 
Returns OpenEdge.Core.File
  File A file instance representing the operation target path/file
Top

CHARACTER ResolveTokens (MappedOperation, IWebRequest)

/* Resolves any tokens in the file name (TargetName) into appropriate values
Parameters:
poOperation OpenEdge.Web.DataObject.MappedOperation
 
poRequest OpenEdge.Web.IWebRequest
 
Returns CHARACTER
  character The resolved filename
Top

ValidatePath (FileInfo, Folder)

/* Ensures that the file or folder is in an appropriate location
Parameters:
pPath OpenEdge.Core.FileInfo
 
pWebAppPath OpenEdge.Core.Folder
 
Top

INTEGER Write (MappedOperation, IWebRequest, Object, IHttpResponse)

/* Writes a file to disk from the request's Entity
Parameters:
poOperation OpenEdge.Web.DataObject.MappedOperation
 
poRequest OpenEdge.Web.IWebRequest
 
poMessageBody Progress.Lang.Object
 
poResponse OpenEdge.Net.HTTP.IHttpResponse
 
Returns INTEGER
  integer The status code to return


Constructor Detail
Top

FileOperationHandler ()

/* Default constructor


Property Detail
Top

OpenEdge.Logging.ILogWriter Logger

Returns OpenEdge.Logging.ILogWriter