Esempio n. 1
0
        internal static void UploadStream <T>(
            this IKuduClient client,
            Stream sourceStream,
            T remotePath,
            Func <T, string> encodeRemotePathFunc, // ReSharper disable once UnusedParameter.Global
            bool allowNullStream = false)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            if (!allowNullStream && sourceStream == null)
            {
                throw new ArgumentNullException(nameof(sourceStream));
            }

            if (remotePath == null)
            {
                throw new ArgumentNullException(nameof(remotePath));
            }

            client.HttpPutStream(
                encodeRemotePathFunc(remotePath),
                sourceStream);
        }