get uploaded filename, is there a easy way in RESTEasy?
184833
private String getFileName(MultivaluedMap<String, String> header) {

		String[] contentDisposition = header.getFirst("Content-Disposition").split(";");

		for (String filename : contentDisposition) {
			if ((filename.trim().startsWith("filename"))) {

				String[] name = filename.split("=");

				String finalFileName = name[1].trim().replaceAll("\"", "");
				return finalFileName;
			}
		}
		return "unknown";
	}
1082175
def get_new_filename(self, name):
        """"""
        name = MigrationFile.normalize_name(name)
        migrations = self.get_migration_files()
        migration_id = migrations[-1].id if migrations else 0
        migration_id += 1
        return '{:04}_{}.py'.format(migration_id, name)
470410
def _get_fs(name, blade):
    '''
    
    '''
    _fs = []
    _fs.append(name)
    try:
        res = blade.file_systems.list_file_systems(names=_fs)
        return res.items[0]
    except rest.ApiException:
        return None
376792
def submission_storage_path(instance, filename):
    
    string = '/'.join(['submissions', instance.submission_user.user_nick, str(instance.submission_question.question_level), str(instance.submission_question.question_level_id)])
    string += '/'+datetime.datetime.now().strftime("%I:%M%p-%m-%d-%Y")
    string += filename
    return string
1025289
private String getFileName(String contentDisposition) {
		String fileName = null;

		if (contentDisposition != null) {
			String cdl = contentDisposition.toLowerCase();

			if (cdl.startsWith(FORM_DATA) || cdl.startsWith(ATTACHMENT)) {

				ParameterParser parser = new ParameterParser();
				parser.setLowerCaseNames(true);

				// parameter parser can handle null input
				Map<String,String> params = parser.parse(contentDisposition, ';');
				if (params.containsKey("filename")) {
					fileName = (String) params.get("filename");
					if (fileName != null) {
						fileName = fileName.trim();
					} else {
						// even if there is no value, the parameter is present,
						// so we return an empty file name rather than no file
						// name.
						fileName = "";
					}
				}
			}
		}

		return fileName;
	}
1166112
def _get_filename(request, item):
        
        if request.keep_image_names:
            filename = OgcImageService.finalize_filename(item['niceName'].replace(' ', '_'))
        else:
            filename = OgcImageService.finalize_filename(
                '_'.join([str(GeopediaService._parse_layer(request.layer)), item['objectPath'].rsplit('/', 1)[-1]]),
                request.image_format
            )

        LOGGER.debug("filename=%s", filename)
        return filename
1296708
private String getRemoteFileName(UploadFile file) {

        // if the remote path ends with /
        // it means that the remote path specifies only the directory structure, so
        // get the remote file name from the local file
        if (file.getProperty(PARAM_REMOTE_PATH).endsWith("/")) {
            return file.getName(service);
        }

        // if the remote path contains /, but it's not the last character
        // it means that I have something like: /path/to/myfilename
        // so the remote file name is the last path element (myfilename in this example)
        if (file.getProperty(PARAM_REMOTE_PATH).contains("/")) {
            String[] tmp = file.getProperty(PARAM_REMOTE_PATH).split("/");
            return tmp[tmp.length - 1];
        }

        // if the remote path does not contain /, it means that it specifies only
        // the remote file name
        return file.getProperty(PARAM_REMOTE_PATH);
    }
799973
def _upload_check(self, upload_info, resumable=False):
        """"""
        return self._api.upload_check(
            filename=upload_info.name,
            size=upload_info.size,
            hash_=upload_info.hash_info.file,
            folder_key=upload_info.folder_key,
            filedrop_key=upload_info.filedrop_key,
            path=upload_info.path,
            resumable=resumable
        )
611352
def filename(self):
        """"""
        if self.value and 'value' in self._json_data and self._json_data['value']:
            return self._json_data['value'].split('/')[-1]
        return None
74412
def filename(value):
        '''
        
        '''
        return re.sub('[^a-zA-Z0-9.-_ ]', '', os.path.basename(InputSanitizer.trim(value)))
1234651
def upload_check(self, filename=None, folder_key=None, filedrop_key=None,
                     size=None, hash_=None, path=None, resumable=None):
        
        return self.request('upload/check', QueryParams({
            'filename': filename,
            'folder_key': folder_key,
            'filedrop_key': filedrop_key,
            'size': size,
            'hash': hash_,
            'path': path,
            'resumable': resumable
        }))
1200789
def getsavefilename(parent=None, caption='', basedir='', filters='',
                    selectedfilter='', options=None):
    """"""
    return _qfiledialog_wrapper('getSaveFileName', parent=parent,
                                caption=caption, basedir=basedir,
                                filters=filters, selectedfilter=selectedfilter,
                                options=options)
710864
def get_filename(disposition):
    
    if disposition:
        params = [param.strip() for param in disposition.split(';')[1:]]
        for param in params:
            if '=' in param:
                name, value = param.split('=', 1)
                if name == 'filename':
                    return value.strip('"')
516558
def get_filename(cls):
        
        config_home = os.environ.get("XDG_CONFIG_HOME", "~/.config")
        config_home = os.path.expanduser(config_home)

        base_path = os.path.join(config_home, "PyPump")
        if not os.path.isdir(base_path):
            os.makedirs(base_path)

        return os.path.join(base_path, "credentials.json")
206158
def filenameToModname(self, filename):
        """"""
        for ext in reversed(self._exts):
            if filename.endswith(ext):
                filename = filename[:-len(ext)]
                break
        else:
            self.warn(filename, '%s: unknown file name extension', filename)
        filename = os.path.abspath(filename)
        elements = filename.split(os.path.sep)
        modname = []
        while elements:
            modname.append(elements[-1])
            del elements[-1]
            if not os.path.exists(os.path.sep.join(elements + ['__init__.py'])):
                break
        modname.reverse()
        modname = ".".join(modname)
        return modname
1016279
function(err, str, fileDetails) {
      if (err) {
        return cb(err);
      }

      var res = {
        stream: str,
        type: fileDetails.contentType,
        length: fileDetails.length,
        name: fileDetails.filename
      };
      return cb(undefined, res);
    }
964258
def _get_filename(self):
        """"""
        if self._fname is None:
            timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
            fname = "%s-%s.log" % (timestamp, abs(id(self)))
            self._fname = os.path.join(self.file_path, fname)
        return self._fname