<commit_before>/**
* Copyright (c) Microsoft.  All rights reserved.
*
* Licensed 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.
*/

'use strict';
var util = require('util');
var fs = require('fs');
var progress = require('progress');
var profile = require('../../../util/profile');
var utils = require('../../../util/utils');
var tagUtils = require('../tag/tagUtils');
var $ = utils.getLocaleString;
var dataLakeStoreUtils = require('./datalakestore.utils');
// required functions for reading data
var readStreamToBuffer = function (strm, callback) {
  var bufs = [];
  strm.on('data', function (d) {
    bufs.push(d);
  });
  strm.on('end', function () {
    callback(null, Buffer.concat(bufs));
  });
};

exports.init = function (cli) {
  var log = cli.output;
  var withProgress = cli.interaction.withProgress.bind(cli.interaction);
  
  // This includes the following three categories:
  // Account Management (category of 'Account')
  // FileSystem Management (category of 'FileSystem')
  // FileSystem Permissions Management (category of 'Permissions')
  var dataLakeCommands = cli.category('datalake')
    .description($('Commands to manage your Data Lake objects'));
  
  var dataLakeStoreCommands = dataLakeCommands.category('store')
    .description($('Commands to manage your Data Lake Storage objects'));
  
  
  var dataLakeStoreFileSystem = dataLakeStoreCommands.category('filesystem')
    .description($('Commands to manage your Data Lake Storage FileSystem'));
  
  var dataLakeStoreFileSystemExpiry = dataLakeStoreFileSystem.category('expiry')
    .description($('Commands to manage expiration of your Data Lake Storage FileSystem'));
  
  dataLakeStoreFileSystemExpiry.command('set [accountName] [path]')
    .description($('sets or removes the absolute expiration time of the specified path (files only).'))
    .usage('[options] <accountName> <path>')
    .option('-n --accountName <accountName>', $('the Data Lake Store account name to execute the action on'))
    .option('-p --path <path>', $('the full path to the folder to list (e.g. /someFolder or /someFolder/someNestedFolder)'))
    .option('-e --expiration <expiration time in ticks since epoch>', $('the expiration time to set for the file. Values <= 0 or >= 253402300800000 indicate the file will never expire.)'))
    .option('-s, --subscription <id>', $('the subscription identifier'))
    .execute(function (accountName, path, options, _) {
    if (!accountName) {
      return cli.missingArgument('accountName');
    }
    
    if (!path) {
      return cli.missingArgument('path');
    }
    
    var subscription = profile.current.getSubscription(options.subscription);
    var client = utils.createDataLakeStoreFileSystemManagementClient(subscription);
    var fileStatus = client.fileSystem.getFileStatus(accountName, path, _).fileStatus;
    if(fileStatus.type !== 'FILE') {
      throw new Error($('Expiration can only be set on files (not on folders). Please specify a file path with the --path parameter. Path given: ' + path));<commit_msg>remove extra new line.<commit_after>/**
* Copyright (c) Microsoft.  All rights reserved.
*
* Licensed 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.
*/

'use strict';
var util = require('util');
var fs = require('fs');
var progress = require('progress');
var profile = require('../../../util/profile');
var utils = require('../../../util/utils');
var tagUtils = require('../tag/tagUtils');
var $ = utils.getLocaleString;
var dataLakeStoreUtils = require('./datalakestore.utils');
// required functions for reading data
var readStreamToBuffer = function (strm, callback) {
  var bufs = [];
  strm.on('data', function (d) {
    bufs.push(d);
  });
  strm.on('end', function () {
    callback(null, Buffer.concat(bufs));
  });
};

exports.init = function (cli) {
  var log = cli.output;
  var withProgress = cli.interaction.withProgress.bind(cli.interaction);
  
  // This includes the following three categories:
  // Account Management (category of 'Account')
  // FileSystem Management (category of 'FileSystem')
  // FileSystem Permissions Management (category of 'Permissions')
  var dataLakeCommands = cli.category('datalake')
    .description($('Commands to manage your Data Lake objects'));
  
  var dataLakeStoreCommands = dataLakeCommands.category('store')
    .description($('Commands to manage your Data Lake Storage objects'));
  
  var dataLakeStoreFileSystem = dataLakeStoreCommands.category('filesystem')
    .description($('Commands to manage your Data Lake Storage FileSystem'));
  
  var dataLakeStoreFileSystemExpiry = dataLakeStoreFileSystem.category('expiry')
    .description($('Commands to manage expiration of your Data Lake Storage FileSystem'));
  
  dataLakeStoreFileSystemExpiry.command('set [accountName] [path]')
    .description($('sets or removes the absolute expiration time of the specified path (files only).'))
    .usage('[options] <accountName> <path>')
    .option('-n --accountName <accountName>', $('the Data Lake Store account name to execute the action on'))
    .option('-p --path <path>', $('the full path to the folder to list (e.g. /someFolder or /someFolder/someNestedFolder)'))
    .option('-e --expiration <expiration time in ticks since epoch>', $('the expiration time to set for the file. Values <= 0 or >= 253402300800000 indicate the file will never expire.)'))
    .option('-s, --subscription <id>', $('the subscription identifier'))
    .execute(function (accountName, path, options, _) {
    if (!accountName) {
      return cli.missingArgument('accountName');
    }
    
    if (!path) {
      return cli.missingArgument('path');
    }
    
    var subscription = profile.current.getSubscription(options.subscription);
    var client = utils.createDataLakeStoreFileSystemManagementClient(subscription);
    var fileStatus = client.fileSystem.getFileStatus(accountName, path, _).fileStatus;
    if(fileStatus.type !== 'FILE') {
      throw new Error($('Expiration can only be set on files (not on folders). Please specify a file path with the --path parameter. Path given: ' + path));
{'fraction_non_alphanumeric': 0.12890847072200115, 'fraction_numerical': 0.005685048322910745, 'mean_word_length': 4.204881656804734, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2005600', 'n_tokens_mistral': 1952, 'n_tokens_neox': 1939, 'n_words': 672}