All Pega Cloud 2 clients who refer to the local sync-data file system folder must refactor to use the Pega Cloud File storage repository as soon as possible. Any code that still refers to the local sync-data file system folder may experience errors until you refactor to the Pega Cloud File storage repository. This refactoring is also a pre-requisite for updating to Pega Cloud 3.
Steps to refactor to the Pega Cloud File storage repository
- Search for “sync-data” across your applications in Pega Platform.
- Wherever “sync-data” appears in a file path, replace the file path up to and including "sync-data" with “file://pegacloudrepository:” or “file://pegacloudfilestorage:/sftp”. Any subfolders after "sync-data" should remain the same. For example:
- "/usr/local/tomcat/work/sync-data" becomes "file://pegacloudrepository:" or “file://pegacloudfilestorage:/sftp”.
- "/usr/local/tomcat/work/sync-data/bix/" becomes “file://pegacloudrepository:/bix” or “file://pegacloudfilestorage:/sftp/bix”.
- Exception: If “sync-data” appears in a Pega rule labeled “Final” in your search, just ignore it. Do not change it. This happens most often with pzCheckIsInValidSource. This Exception applies to all actions in steps 2-5 of these instructions.
- Wherever the sync-data file path appears in combination with java.io.File, replace java.io.File with PRFile. For example:
- java.io.File tempFile = new java.io.File("/usr/local/tomcat/work/sync-data/bix/" + filename); becomes PRFile tempFile = new PRFile("file://pegacloudrepository:/bix/" + filename);
- Wherever the sync-data file path appears in combination with java.io.FileInputStream, replace java.io.FileInputStream with PRInputStream. For example:
- java.io.InputStream inputStream = new java.io.FileInputStream("/usr/local/tomcat/work/sync-data/bix/" + filename); becomes java.io.InputStream inputStream = new PRInputStream("file://pegacloudrepository:/bix/" + filename);
- Wherever the sync-data file path appears in combination with java.io.FileOutputStream, replace java.io.FileOutputStream with PROutputStream. For example:
- java.io.OutputStream outputStream = new java.io.FileOutputStream("/usr/local/tomcat/work/sync-data/bix/" + filename); becomes java.io.OutputStream outputStream = new PROutputStream("file://pegacloudrepository:/bix/" + filename);
If the searches yield no results, you are not using the local file system path and do not need to take any further action. For more information about file storage, see Using Pega Cloud File storage.
For Java API reference links, see PegaRULES Java Engine v8.8.0 - PUBLIC, Class PRFile, Class PRInputStream, and Class PROutputStream.