Skip to content

Commit aaedaca

Browse files
Issue #LR-546 merge: adding newline in the encrypted content (#41)
* LR-546 PII code implementation for data-products * LR-546 code changes for PII in reports * LR-546 code changes for PII in reports * LR-546 removed pom changes * LR-546 removed unnecessary test file changes * LR-546 removed duplicate code * LR-546 tested zip functionality * LR-546 removed token details from conf * LR-546 added test cases * LR-546 removed access-token from request * LR-546 removed unused methods from HttpUtil * LR-546 code changes against review points * LR-546 code changes against review points * LR-546 code changes against review points * LR-546 code changes against review points * LR-546 test-case fix * LR-546 test-case fix-1 * LR-546 test-case fix-2 * LR-546 code fixes for PII changes * LR-546 code fixes for PII changes-1 * LR-546 code fixes for PII changes-2 * LR-546 level codes changed * LR-546 removed level and orgid details from JobRequest * LR-546 removed level and orgid details from JobRequest-1 * LR-546 ignoring test-cases * LR-546 modified Encrypt util * LR-546 expection with tenant preferance endpoint configuration * LR-546 expection with tenant preferance endpoint configuration-1 * LR-546 expection with tenant preferance endpoint configuration-2 * LR-546 expection with tenant preferance endpoint configuration-3 * LR-546 dev env configuration changes for spark * LR-546 added logs * LR-546 added logs-1 * LR-546 added logs-2 * LR-546 added logs-3 * LR-546 added logs-4 * LR-546 added logs-5 * LR-546 added logs-6 * LR-546 added logs-7 * LR-546 added logs-8 * LR-546 L3 level eccryption throwing errors * LR-546 L3 level eccryption throwing errors-1 * LR-546 L3 level eccryption throwing errors-2 * LR-546 config changes * LR-546 commented test-cases * Delete BaseCollectionExhaustJob1.scala * LR-546 ignored test-cases * LR-546 ignored test-cases-1 * LR-546 ignored test-cases-2 * LR-546 ignored test-cases-2 * LR-546 ignored test-cases-3 * LR-546 ignored test-cases-4 * LR-546 added new line between ecrypted text and file content
1 parent b27102a commit aaedaca

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lern-data-products/src/main/scala/org/sunbird/core/util/EncryptFileUtil.scala

+9-5
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,17 @@ object EncryptFileUtil extends Serializable {
6060

6161
try {
6262
val file = new File(pathTuple._1)
63-
val outputStream : FileOutputStream = new FileOutputStream(file)
63+
import java.io.BufferedWriter
64+
import java.io.OutputStreamWriter
65+
val bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"))
6466
try {
65-
outputStream.write(level.getBytes)
66-
outputStream.write(encryptedUUIDBytes)
67-
outputStream.write(encryptedAESContent)
67+
bufferedWriter.write(level)
68+
bufferedWriter.newLine()
69+
bufferedWriter.write(new String(encryptedUUIDBytes))
70+
bufferedWriter.newLine()
71+
bufferedWriter.write(new String(encryptedAESContent))
6872
}
69-
finally if (outputStream != null) outputStream.close()
73+
finally if (bufferedWriter != null) bufferedWriter.close()
7074
}
7175
}
7276

0 commit comments

Comments
 (0)