martinzink commented on code in PR #1634:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1634#discussion_r1324615415


##########
extensions/smb/PutSmb.cpp:
##########
@@ -0,0 +1,94 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "PutSmb.h"
+#include "utils/gsl.h"
+#include "utils/ProcessorConfigUtils.h"
+#include "utils/OsUtils.h"
+#include "utils/file/FileWriterCallback.h"
+#include "core/Resource.h"
+
+namespace org::apache::nifi::minifi::extensions::smb {
+
+void PutSmb::initialize() {
+  setSupportedProperties(Properties);
+  setSupportedRelationships(Relationships);
+}
+
+void PutSmb::onSchedule(core::ProcessContext* context, 
core::ProcessSessionFactory*) {
+  gsl_Expects(context);
+  smb_connection_controller_service_ = 
SmbConnectionControllerService::getFromProperty(*context, 
PutSmb::ConnectionControllerService);
+  create_missing_dirs_ = 
context->getProperty<bool>(PutSmb::CreateMissingDirectories).value_or(true);
+  conflict_resolution_strategy_ = 
utils::parseEnumProperty<FileExistsResolutionStrategy>(*context, 
ConflictResolution);

Review Comment:
   Yeah, Im a bit torn on it. I think we should definetly throw on new 
processors like PutSmb, but since I also changed it in PutFile im not sure if 
we should do this.
   
   Imho we should throw everywhere if we encounter invalid configs like this, 
or if thats too drastic we should change them to throw after 1.0 release.
   
   In the meantime I've added a WIP commit that reverts PutFile to the older 
behaviour. 
https://github.com/apache/nifi-minifi-cpp/pull/1634/commits/0dd3adf71b517621274bc06891d29f259f63f4d1
   
   If you like it I can add some tests or maybe we could implement monoadic 
operators to nonstd::expected aswell which would make them easier to use.
   Or if we take a bit more aggressive stance on this I can just revert this 
commit and let it throw...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to