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

/* *************************************************************************************************************************
Copyright (c) 2016, 2018 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 (handle) /* Ensures that we have read permissions for this file @param handle The FILE-INFO handle representing the file */
CanWrite (handle) /* Ensures that we have write permissions for this file @param handle The FILE-INFO handle representing the file */
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 @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 */
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 */
ValidateDirectory (handle, character) /* Ensures that the file is in an appropriate location @param handle The FILE-INFO handle representing the directory @param character The tomcat webapp path */
ValidateFile (handle, character) /* Ensures that the file is in an appropriate location @param handle The FILE-INFO handle representing the file @param character The tomcat webapp name */
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 ()

Property Summary
Options Name Purpose
OpenEdge.Logging.ILogWriter Logger


Method Detail
Top

PRIVATE CanRead (handle)

/* Ensures that we have read permissions for this file
Parameters:
phFile HANDLE
Top

PRIVATE CanWrite (handle)

/* Ensures that we have write permissions for this file
Parameters:
phFile HANDLE
Top

PUBLIC 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

PROTECTED INTEGER Read (MappedOperation, IWebRequest, IHttpResponse)

/* Reads a file off disk and puts it into the response Entity
Parameters:
poOperation OpenEdge.Web.DataObject.MappedOperation
poRequest OpenEdge.Web.IWebRequest
poResponse OpenEdge.Net.HTTP.IHttpResponse
Returns INTEGER
integer The status code to return
Top

PROTECTED 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

PROTECTED 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

PRIVATE ValidateDirectory (handle, character)

/* Ensures that the file is in an appropriate location
Parameters:
phFile HANDLE
pcWebAppPath CHARACTER
Top

PRIVATE ValidateFile (handle, character)

/* Ensures that the file is in an appropriate location
Parameters:
phFile HANDLE
pcWebAppPath CHARACTER
Top

PROTECTED 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

PUBLIC FileOperationHandler ()



Property Detail
Top

PUBLIC OpenEdge.Logging.ILogWriter Logger

Returns OpenEdge.Logging.ILogWriter


Copyright © 2020 Progress Software Corporation. All rights Reserved.

Progress® OpenEdge® Release 12.2.0